This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix ppc32 -pie handling
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>, Alan Modra <amodra at bigpond dot net dot au>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Feb 2005 10:57:20 -0500
- Subject: [PATCH] Fix ppc32 -pie handling
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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