aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGregor Richards <gregor.richards@uwaterloo.ca>2015-10-20 23:42:17 +0000
committerAlan Modra <amodra@gcc.gnu.org>2015-10-21 10:12:17 +1030
commitefbab234a3e3fb4f9378279a64a308d9d3489ba7 (patch)
tree0ba3cf4044cedd5bb6c4c9a33c73817a1328cd0d /gcc
parent9ef83c047fe2cbeba27d814d2b7262b44688b128 (diff)
downloadgcc-efbab234a3e3fb4f9378279a64a308d9d3489ba7.zip
gcc-efbab234a3e3fb4f9378279a64a308d9d3489ba7.tar.gz
gcc-efbab234a3e3fb4f9378279a64a308d9d3489ba7.tar.bz2
Pass --secure-plt to the linker
* config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define. * config/rs6000/sysv4.h (LINK_SECURE_PLT_SPEC): Define. (LINK_SPEC): Add %(link_secure_plt). (SUBTARGET_EXTRA_SPECS): Add "link_secure_plt". * config/rs6000/linux64.h (LINK_SECURE_PLT_SPEC): Redefine. Co-Authored-By: Alan Modra <amodra@gmail.com> Co-Authored-By: Szabolcs Nagy <szabolcs.nagy@arm.com> From-SVN: r229102
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/rs6000/linux64.h4
-rw-r--r--gcc/config/rs6000/secureplt.h1
-rw-r--r--gcc/config/rs6000/sysv4.h6
4 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7321619..77f659b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2015-10-21 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+ Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define.
+ * config/rs6000/sysv4.h (LINK_SECURE_PLT_SPEC): Define.
+ (LINK_SPEC): Add %(link_secure_plt).
+ (SUBTARGET_EXTRA_SPECS): Add "link_secure_plt".
+ * config/rs6000/linux64.h (LINK_SECURE_PLT_SPEC): Redefine.
+
2015-10-20 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 1948e86..41472f4 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -174,20 +174,24 @@ extern int dot_symbols;
#undef ASM_DEFAULT_SPEC
#undef ASM_SPEC
#undef LINK_OS_LINUX_SPEC
+#undef LINK_SECURE_PLT_SPEC
#ifndef RS6000_BI_ARCH
#define ASM_DEFAULT_SPEC "-mppc64"
#define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
#define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
+#define LINK_SECURE_PLT_SPEC ""
#else
#if DEFAULT_ARCH64_P
#define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
#define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
#define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
+#define LINK_SECURE_PLT_SPEC "%{m32: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
#else
#define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
#define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
#define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
+#define LINK_SECURE_PLT_SPEC "%{!m64: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
#endif
#endif
diff --git a/gcc/config/rs6000/secureplt.h b/gcc/config/rs6000/secureplt.h
index b463463..77edf2a 100644
--- a/gcc/config/rs6000/secureplt.h
+++ b/gcc/config/rs6000/secureplt.h
@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index f48af43..adb4333 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
#endif
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
+#endif
/* Pass -G xxx to the compiler. */
#undef CC1_SPEC
@@ -567,6 +570,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
: %(link_start_default) }"
#define LINK_START_DEFAULT_SPEC ""
+#define LINK_SECURE_PLT_SPEC LINK_SECURE_PLT_DEFAULT_SPEC
#undef LINK_SPEC
#define LINK_SPEC "\
@@ -574,6 +578,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
%{R*} \
%(link_shlib) \
%{!T*: %(link_start) } \
+%{!static: %{!mbss-plt: %(link_secure_plt)}} \
%(link_os)"
/* Shared libraries are not default. */
@@ -889,6 +894,7 @@ ncrtn.o%s"
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
+ { "link_secure_plt", LINK_SECURE_PLT_SPEC }, \
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \