This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for PR 12537


On Sat, Oct 18, 2003 at 02:24:35PM -0700, Geoff Keating wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
> 
> ...
> > Tue Aug 20 18:49:55 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
> > 
> > 	* rs6000/sysv4.h (ASM_OUTPUT_SECTION_NAME): If -mrelocatable or
> > 	-mrelocatable-lib, don't make read-only sections.
> 
> This looks like a broken workaround for some bug in the middle-end or
> elsewhere in this backend that probably doesn't exist any more.  Let's
> try taking it out and seeing what happens.  If TARGET_RELOCATABLE,
> then flag_pic will be set to 2 by SUBTARGET_OVERRIDE_OPTIONS in
> sysv4.h, so any section that actually needs fixups should be made
> writable by default_section_type_flags_1 anyway.

Another post reminded me that I didn't get back to you on this.  The
following has been bootstrapped and regression tested (with multiple
versions of gcc) on powerpc-linux and powerpc64-linux.  OK to install?
gcc-3.3 branch too?

	 * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Don't
	 set SECTION_WRITE on TARGET_RELOCATABLE.

diff -urpN -xCVS -x'*~' -x'*.info*' -x'*.[17]' -xTAGS gcc-ppc64-34.orig/gcc/config/rs6000/rs6000.c gcc-ppc64-34/gcc/config/rs6000/rs6000.c
--- gcc-ppc64-34.orig/gcc/config/rs6000/rs6000.c	2003-11-25 00:28:48.000000000 +1030
+++ gcc-ppc64-34/gcc/config/rs6000/rs6000.c	2003-11-19 21:51:37.000000000 +1030
@@ -14991,14 +14991,8 @@ toc_section (void)
 static unsigned int
 rs6000_elf_section_type_flags (tree decl, const char *name, int reloc)
 {
-  unsigned int flags
-    = default_section_type_flags_1 (decl, name, reloc,
-				    flag_pic || DEFAULT_ABI == ABI_AIX);
-
-  if (TARGET_RELOCATABLE)
-    flags |= SECTION_WRITE;
-
-  return flags;
+  return default_section_type_flags_1 (decl, name, reloc,
+				       flag_pic || DEFAULT_ABI == ABI_AIX);
 }
 
 /* Record an element in the table of global constructors.  SYMBOL is


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]