gnu.h (STARTFILE_SPEC): Use gcrt0.o in profile mode, add -profile option, add pie...
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 8 Aug 2007 06:35:17 +0000 (06:35 +0000)
committerMatthias Klose <doko@gcc.gnu.org>
Wed, 8 Aug 2007 06:35:17 +0000 (06:35 +0000)
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

gcc/ChangeLog
gcc/config/gnu.h
gcc/config/i386/gnu.h

index 8c4f0e1a537a5a2f1fec3847234a07d8784dd0cc..15deba017eb1906f3cb151c3efe59ae0e0f16a4c 100644 (file)
@@ -1,3 +1,10 @@
+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.
index 93b94b1aa9c174262e14c2b434d8b7030f6826d3..b7fefa4427c130385471041838b2540f98fa5bb5 100644 (file)
@@ -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
index e303bce25fc09287122e494bcbeab8ee04a3b7e5..a2b4f24291c52a8d36e64e34e6076ec06b58b5b7 100644 (file)
     %{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