aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-08-12 09:58:04 +0930
committerAlan Modra <amodra@gcc.gnu.org>2017-08-12 09:58:04 +0930
commitff97dd826e77fa9ee1f3c89a73e2cee855cf5fb9 (patch)
tree878ec8a8752c039952f66556cfc6411fb8a5d528 /gcc
parent9567c62efb83a03348971a01cc6f6d0ec5d79908 (diff)
downloadgcc-ff97dd826e77fa9ee1f3c89a73e2cee855cf5fb9.zip
gcc-ff97dd826e77fa9ee1f3c89a73e2cee855cf5fb9.tar.gz
gcc-ff97dd826e77fa9ee1f3c89a73e2cee855cf5fb9.tar.bz2
[RS6000] linux startfile/endfile
These need to match the gnu-user.h definitions to support --enable-default-pie. Otherwise we end up linking the wrong startup files when defaulting to PIE. PR target/81170 PR target/81295 * config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Upgrade to match gnu-user.h startfile. (ENDFILE_LINUX_SPEC): Similarly. From-SVN: r251065
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/rs6000/sysv4.h46
2 files changed, 36 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 295b4c9..55645ca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-12 Alan Modra <amodra@gmail.com>
+
+ PR target/81170
+ PR target/81295
+ * config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Upgrade to
+ match gnu-user.h startfile.
+ (ENDFILE_LINUX_SPEC): Similarly.
+
2017-08-11 Thomas Schwinge <thomas@codesourcery.com>
PR lto/81430
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index de38629..cbee891 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -757,24 +757,34 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
#define CRTOFFLOADEND ""
#endif
-#ifdef HAVE_LD_PIE
-#define STARTFILE_LINUX_SPEC "\
-%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
-%{mnewlib:ecrti.o%s;:crti.o%s} \
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
-" CRTOFFLOADBEGIN
-#else
-#define STARTFILE_LINUX_SPEC "\
-%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
-%{mnewlib:ecrti.o%s;:crti.o%s} \
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
-" CRTOFFLOADBEGIN
-#endif
-
-#define ENDFILE_LINUX_SPEC "\
-%{shared|pie:crtendS.o%s;:crtend.o%s} \
-%{mnewlib:ecrtn.o%s;:crtn.o%s} \
-" CRTOFFLOADEND
+/* STARTFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_STARTFILE_SPEC
+ but with the mnewlib ecrti.o%s selection substituted for crti.o%s. */
+#define STARTFILE_LINUX_SPEC \
+ "%{shared:; \
+ pg|p|profile:gcrt1.o%s; \
+ static:crt1.o%s; \
+ " PIE_SPEC ":Scrt1.o%s; \
+ :crt1.o%s} \
+ %{mnewlib:ecrti.o%s;:crti.o%s} \
+ %{static:crtbeginT.o%s; \
+ shared|" PIE_SPEC ":crtbeginS.o%s; \
+ :crtbegin.o%s} \
+ %{fvtable-verify=none:%s; \
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
+ fvtable-verify=std:vtv_start.o%s} \
+ " CRTOFFLOADBEGIN
+
+/* ENDFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_ENDFILE_SPEC
+ but with the mnewlib ecrtn.o%s selection substituted for crtn.o%s. */
+#define ENDFILE_LINUX_SPEC \
+ "%{fvtable-verify=none:%s; \
+ fvtable-verify=preinit:vtv_end_preinit.o%s; \
+ fvtable-verify=std:vtv_end.o%s} \
+ %{static:crtend.o%s; \
+ shared|" PIE_SPEC ":crtendS.o%s; \
+ :crtend.o%s} \
+ %{mnewlib:ecrtn.o%s;:crtn.o%s} \
+ " CRTOFFLOADEND
#define LINK_START_LINUX_SPEC ""