summaryrefslogtreecommitdiff
path: root/system/gcc/fix-rs6000-pie.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/gcc/fix-rs6000-pie.patch')
-rw-r--r--system/gcc/fix-rs6000-pie.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/system/gcc/fix-rs6000-pie.patch b/system/gcc/fix-rs6000-pie.patch
new file mode 100644
index 000000000..1fbc31a56
--- /dev/null
+++ b/system/gcc/fix-rs6000-pie.patch
@@ -0,0 +1,59 @@
+--- gcc-6.3.0.orig/gcc/config/rs6000/sysv4.h
++++ gcc-6.3.0/gcc/config/rs6000/sysv4.h
+@@ -753,23 +753,42 @@
+ #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
++#define STARTFILE_LINUX_SPEC \
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;: \
++ %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
++ crti.o%s %{shared:crtbeginS.o%s;: \
++ %{" PIE_SPEC ":crtbeginS.o%s} \
++ %{" NO_PIE_SPEC ":%{static:crtbeginT.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
+ #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
++#define STARTFILE_LINUX_SPEC \
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{static:crtbeginT.o%s;shared|pie: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
+ #endif
+
+-#define ENDFILE_LINUX_SPEC "\
+-%{shared|pie:crtendS.o%s;:crtend.o%s} \
+-%{mnewlib:ecrtn.o%s;:crtn.o%s} \
+-" CRTOFFLOADEND
++#ifdef HAVE_LD_PIE
++#define ENDFILE_LINUX_SPEC \
++ "%{fvtable-verify=none:%s; \
++ fvtable-verify=preinit:vtv_end_preinit.o%s; \
++ fvtable-verify=std:vtv_end.o%s} \
++ %{shared:crtendS.o%s;: %{" PIE_SPEC ":crtendS.o%s} \
++ %{" NO_PIE_SPEC ":crtend.o%s}} crtn.o%s \
++ " CRTOFFLOADEND
++#else
++#define ENDFILE_LINUX_SPEC \
++ "%{fvtable-verify=none:%s; \
++ fvtable-verify=preinit:vtv_end_preinit.o%s; \
++ fvtable-verify=std:vtv_end.o%s} \
++ %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s \
++ " CRTOFFLOADEND
++#endif
+
+ #define LINK_START_LINUX_SPEC ""
+