Commit 9515381d by Alan Modra Committed by Alan Modra

Allow target to override gnu-user.h crti and crtn

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
parent 003fc14b
2018-11-18 Alan Modra <amodra@gmail.com> 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 * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Delete
!HAVE_LD_PIE variant. !HAVE_LD_PIE variant.
(GNU_USER_TARGET_ENDFILE_SPEC): Likewise. (GNU_USER_TARGET_ENDFILE_SPEC): Likewise.
...@@ -40,6 +40,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -40,6 +40,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define CRTOFFLOADEND "" #define CRTOFFLOADEND ""
#endif #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 /* Provide a STARTFILE_SPEC appropriate for GNU userspace. Here we add
the GNU userspace magical crtbegin.o file (see crtstuff.c) which the GNU userspace magical crtbegin.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static 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 ...@@ -51,8 +54,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
static:crt1.o%s; \ static:crt1.o%s; \
static-pie:rcrt1.o%s; \ static-pie:rcrt1.o%s; \
" PIE_SPEC ":Scrt1.o%s; \ " PIE_SPEC ":Scrt1.o%s; \
:crt1.o%s} \ :crt1.o%s} " \
crti.o%s \ GNU_USER_TARGET_CRTI " \
%{static:crtbeginT.o%s; \ %{static:crtbeginT.o%s; \
shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
:crtbegin.o%s} \ :crtbegin.o%s} \
...@@ -75,8 +78,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -75,8 +78,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
fvtable-verify=std:vtv_end.o%s} \ fvtable-verify=std:vtv_end.o%s} \
%{static:crtend.o%s; \ %{static:crtend.o%s; \
shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
:crtend.o%s} \ :crtend.o%s} " \
crtn.o%s " \ GNU_USER_TARGET_CRTN " " \
CRTOFFLOADEND CRTOFFLOADEND
#undef ENDFILE_SPEC #undef ENDFILE_SPEC
#define ENDFILE_SPEC GNU_USER_TARGET_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 ...@@ -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} " #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
#endif #endif
#undef LINK_GCC_C_SEQUENCE_SPEC #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static|static-pie:--start-group} %G %{!nolibc:%L} \ "%{static|static-pie:--start-group} %G %{!nolibc:%L} \
%{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" %{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. */ /* Use --as-needed -lgcc_s for eh support. */
#ifdef HAVE_LD_AS_NEEDED #ifdef HAVE_LD_AS_NEEDED
#define USE_LD_AS_NEEDED 1 #define USE_LD_AS_NEEDED 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment