aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2007-08-08 06:35:17 +0000
committerMatthias Klose <doko@gcc.gnu.org>2007-08-08 06:35:17 +0000
commit5b6693af786130f37f0b7cebe023f8004361ff7f (patch)
tree5185ba498d5c927400c1483ff82be6687d455814
parentcf1c6ebf1319a1fa789dea2e8cd30344cc50795a (diff)
downloadgcc-5b6693af786130f37f0b7cebe023f8004361ff7f.zip
gcc-5b6693af786130f37f0b7cebe023f8004361ff7f.tar.gz
gcc-5b6693af786130f37f0b7cebe023f8004361ff7f.tar.bz2
gnu.h (STARTFILE_SPEC): Use gcrt0.o in profile mode, add -profile option, add pie support.
2007-08-08 Samuel Thibault <samuel.thibault@ens-lyon.org> * gcc/config/i386/gnu.h (STARTFILE_SPEC): Use gcrt0.o in profile mode, add -profile option, add pie support. (ENDFILE_SPEC): New spec. * gcc/config/gnu.h (LIB_SPEC): Add -profile option. From-SVN: r127290
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/gnu.h2
-rw-r--r--gcc/config/i386/gnu.h18
3 files changed, 20 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8c4f0e1..15deba0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2007-08-08 Samuel Thibault <samuel.thibault@ens-lyon.org>
+ * gcc/config/i386/gnu.h (STARTFILE_SPEC): Use gcrt0.o in profile mode, add
+ -profile option, add pie support.
+ (ENDFILE_SPEC): New spec.
+ * gcc/config/gnu.h (LIB_SPEC): Add -profile option.
+
+2007-08-08 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
* gcc/config/i386/gnu.h (CPP_SPEC): Add -pthread option.
* gcc/config/gnu.h (LIB_SPEC): Likewise.
diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h
index 93b94b1..b7fefa4 100644
--- a/gcc/config/gnu.h
+++ b/gcc/config/gnu.h
@@ -6,7 +6,7 @@
/* Default C library spec. Use -lbsd-compat for gcc -bsd. */
#undef LIB_SPEC
-#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{pg|p|profile:-lc_p;:-lc}"
/* Standard include directory. In GNU, "/usr" is a four-letter word. */
#undef STANDARD_INCLUDE_DIR
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index e303bce..a2b4f24 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -26,13 +26,19 @@
%{static:-static}}"
#undef STARTFILE_SPEC
+#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
- "%{!shared: \
- %{!static: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
- %{static:crt0.o%s}} \
- crti.o%s %{static:crtbeginT.o%s}\
- %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+ "%{!shared: %{pg|p|profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#else
+#define STARTFILE_SPEC \
+ "%{!shared: %{pg|p|profile:gcrt0.o%s;static:crt0.o%s;:crt1.o%s}} \
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#endif
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
/* FIXME: Is a Hurd-specific fallback mechanism necessary? */
#undef MD_UNWIND_SUPPORT