Allow target to override gnu-user.h crti and crtn
authorAlan Modra <amodra@gmail.com>
Sun, 18 Nov 2018 10:25:24 +0000 (20:55 +1030)
committerAlan Modra <amodra@gcc.gnu.org>
Sun, 18 Nov 2018 10:25:24 +0000 (20:55 +1030)
Also give target access to the gnu-user.h LINK_GCC_C_SEQUENCE_SPEC.

* config/gnu-user.h (GNU_USER_TARGET_CRTI): Define.
(GNU_USER_TARGET_STARTFILE_SPEC): Use it here.
(GNU_USER_TARGET_CRTN): Define.
(GNU_USER_TARGET_ENDFILE_SPEC): Use it here.
(GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC): Define.

From-SVN: r266250

gcc/ChangeLog
gcc/config/gnu-user.h

index 6539253f8b7b7a42142b2223cb388fe071a652cb..62dd38eef7b70ba70732a38dc7ba0abcd12007a7 100644 (file)
@@ -1,3 +1,11 @@
+2018-11-18  Alan Modra  <amodra@gmail.com>
+
+       * config/gnu-user.h (GNU_USER_TARGET_CRTI): Define.
+       (GNU_USER_TARGET_STARTFILE_SPEC): Use it here.
+       (GNU_USER_TARGET_CRTN): Define.
+       (GNU_USER_TARGET_ENDFILE_SPEC): Use it here.
+       (GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC): Define.
+
 2018-11-18  Alan Modra  <amodra@gmail.com>
 
        * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Delete
index 75f6a6f0a7d1b219a05f101670e0557630ffe395..09170d416b83969af07e8b1e7af5a0ebbf528d49 100644 (file)
@@ -40,6 +40,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define CRTOFFLOADEND ""
 #endif
 
+#define GNU_USER_TARGET_CRTI "crti.o%s"
+#define GNU_USER_TARGET_CRTN "crtn.o%s"
+
 /* Provide a STARTFILE_SPEC appropriate for GNU userspace.  Here we add
    the GNU userspace magical crtbegin.o file (see crtstuff.c) which
    provides part of the support for getting C++ file-scope static
@@ -51,8 +54,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      static:crt1.o%s; \
      static-pie:rcrt1.o%s; \
      " PIE_SPEC ":Scrt1.o%s; \
-     :crt1.o%s} \
-   crti.o%s \
+     :crt1.o%s} \
+   GNU_USER_TARGET_CRTI " \
    %{static:crtbeginT.o%s; \
      shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
      :crtbegin.o%s} \
@@ -75,8 +78,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      fvtable-verify=std:vtv_end.o%s} \
    %{static:crtend.o%s; \
      shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
-     :crtend.o%s} \
-   crtn.o%s " \
+     :crtend.o%s} \
+   GNU_USER_TARGET_CRTN " " \
    CRTOFFLOADEND
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC
@@ -106,11 +109,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
 #endif
 
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC \
+#define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \
   "%{static|static-pie:--start-group} %G %{!nolibc:%L} \
    %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"
 
+#undef LINK_GCC_C_SEQUENCE_SPEC
+#define LINK_GCC_C_SEQUENCE_SPEC GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC
+
 /* Use --as-needed -lgcc_s for eh support.  */
 #ifdef HAVE_LD_AS_NEEDED
 #define USE_LD_AS_NEEDED 1