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]

[PATCH] Fix ppc32 -pie handling


Hi!

GCC on powerpc-*-linux* with -pie uses incorrectly crtend.o instead
of crtendS.o and results in text relocations.
The following fixes it and cleans it up.  Bootstrapped/regtested
on {ppc,ppc64}-redhat-linux.
Ok for HEAD/3.4?

2005-02-11  Jakub Jelinek  <jakub@redhat.com>

	* config/rs6000/sysv4.h (ENDFILE_LINUX_SPEC): Use crtendS.o instead of
	crtend.o if -pie.  Use %{x:a;:b} spec syntax.

--- gcc/config/rs6000/sysv4.h.jj	2004-12-07 09:41:45.000000000 +0100
+++ gcc/config/rs6000/sysv4.h	2005-02-11 13:38:15.592719326 +0100
@@ -1124,8 +1124,9 @@ extern int fixuplabelno;
 %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
-#define	ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
-%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
+#define	ENDFILE_LINUX_SPEC "\
+%{shared|pie:crtendS.o%s;:crtend.o%s} \
+%{mnewlib:ecrtn.o%s;:crtn.o%s}"
 
 #define LINK_START_LINUX_SPEC ""
 

	Jakub


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