]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: [multiple changes]
authorAndreas Tobler <andreast@gcc.gnu.org>
Wed, 11 Nov 2015 21:20:20 +0000 (22:20 +0100)
committerAndreas Tobler <andreast@gcc.gnu.org>
Wed, 11 Nov 2015 21:20:20 +0000 (22:20 +0100)
2015-11-11  Andreas Tobler  <andreast@gcc.gnu.org>

    Backport from mainline
    2015-05-18  Andreas Tobler  <andreast@gcc.gnu.org>

    * config/freebsd-spec.h (FBSD_STARTFILE_SPEC): Add the bits to build
    pie executables.
    (FBSD_ENDFILE_SPEC): Likewise.
    * config/i386/freebsd.h (STARTFILE_SPEC): Remove and use the one from
    config/freebsd-spec.h.
    (ENDFILE_SPEC): Likewise.

    2015-11-02  Andreas Tobler  <andreast@gcc.gnu.org>

    * config/rs6000/freebsd64.h (ASM_SPEC32): Adust spec to handle
    PIE executables.

From-SVN: r230192

gcc/ChangeLog
gcc/config/freebsd-spec.h
gcc/config/i386/freebsd.h
gcc/config/rs6000/freebsd64.h

index 245b6a2a48cd422bb5772a00c3af2b572385c906..c4808a59a2feaa0b91e7148ab4cc82460e5abdad 100644 (file)
@@ -1,3 +1,20 @@
+2015-11-11  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       Backport from mainline
+       2015-05-18  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       * config/freebsd-spec.h (FBSD_STARTFILE_SPEC): Add the bits to build
+       pie executables.
+       (FBSD_ENDFILE_SPEC): Likewise.
+       * config/i386/freebsd.h (STARTFILE_SPEC): Remove and use the one from
+       config/freebsd-spec.h.
+       (ENDFILE_SPEC): Likewise.
+
+       2015-11-02  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       * config/rs6000/freebsd64.h (ASM_SPEC32): Adust spec to handle
+       PIE executables.
+
 2015-11-11  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR target/67265
index 8e7700669731499ddbe33dc05670c8d4d726588b..1e9755756046e9cae17729ce53676bbc65b2a6b8 100644 (file)
@@ -66,8 +66,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   "%{!shared: \
      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
                       %{!p:%{profile:gcrt1.o%s} \
-                        %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+                        %{!profile: \
+                            %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
+   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 
 /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
    the magical crtend.o file (see crtstuff.c) which provides part of 
@@ -76,7 +77,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
        `crtn.o'.  */
 
 #define FBSD_ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
 /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
    required by the user-land thread model.  Before __FreeBSD_version
index bdca1b80b27f489d88347cf681033c85aaaaa279..bb10ce5ba1cd33da2f7f1275082fae38136b2c9f 100644 (file)
@@ -59,28 +59,15 @@ along with GCC; see the file COPYING3.  If not see
 #define SUBTARGET_EXTRA_SPECS \
   { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
     
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD.  Here we add
-   the magical crtbegin.o file (see crtstuff.c) which provides part 
-       of the support for getting C++ file-scope static object constructed 
-       before entering `main'.  */
-   
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-                      %{!p:%{profile:gcrt1.o%s} \
-                        %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
-   the magical crtend.o file (see crtstuff.c) which provides part of 
-       the support for getting C++ file-scope static object constructed 
-       before entering `main', followed by a normal "finalizer" file, 
-       `crtn.o'.  */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+/* Use the STARTFILE_SPEC from config/freebsd-spec.h.  */
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC FBSD_STARTFILE_SPEC
+
+/* Use the ENDFILE_SPEC from config/freebsd-spec.h.  */
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC FBSD_ENDFILE_SPEC
 
 /* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
    for the special GCC options -static and -shared, which allow us to
index 1f3ef199e867d03466d93d92bd13616f7ff371c8..0348670892192ed4ced489f22f7b878e9b3cd13c 100644 (file)
@@ -130,7 +130,7 @@ extern int dot_symbols;
 #define        LINK_OS_FREEBSD_SPEC "%{m32:%(link_os_freebsd_spec32)}%{!m32:%(link_os_freebsd_spec64)}"
 
 #define ASM_SPEC32 "-a32 \
-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
+%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
 %{memb} %{!memb: %{msdata=eabi: -memb}} \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-freebsd: -mbig} \