aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2015-06-29 20:50:57 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2015-06-29 13:50:57 -0700
commit9b552079a19f94b589458f8bdc62a15a27523748 (patch)
tree5b4549cb6da528c558a0f7768041b91962f40bdd
parent24167c42e62564c28c3e1e1159ee78ee6a52a86f (diff)
downloadgcc-9b552079a19f94b589458f8bdc62a15a27523748.zip
gcc-9b552079a19f94b589458f8bdc62a15a27523748.tar.gz
gcc-9b552079a19f94b589458f8bdc62a15a27523748.tar.bz2
Use PIE_SPEC/NO_PIE_SPEC for crtend.o/crtendS.o
We need to link with crtend.o and crtendS.o properly for GCC configured to generate PIE by default. * config/gnu-user.h (GNU_USER_TARGET_ENDFILE_SPEC): Use PIE_SPEC and NO_PIE_SPEC if HAVE_LD_PIE is defined. From-SVN: r225144
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/gnu-user.h9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a14bb04..6aaa0b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/gnu-user.h (GNU_USER_TARGET_ENDFILE_SPEC): Use
+ PIE_SPEC and NO_PIE_SPEC if HAVE_LD_PIE is defined.
+
2015-06-29 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*jcc_1): Use %! in asm template.
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 2fcb55db..5b3576b 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -67,11 +67,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
object constructed before entering `main', followed by a normal
GNU userspace "finalizer" file, `crtn.o'. */
+#if defined HAVE_LD_PIE
+#define GNU_USER_TARGET_ENDFILE_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"
+#else
#define GNU_USER_TARGET_ENDFILE_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"
+#endif
#undef ENDFILE_SPEC
#define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC