Commit 7d27d2fa by Jakub Jelinek Committed by Jakub Jelinek

sysv4.h (STARTFILE_LINUX_SPEC): Add -static-pie support.

	* config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Add -static-pie
	support.
	(ENDFILE_LINUX_SPEC): Likewise.
	(LINK_EH_SPEC): Likewise.
	* config/rs6000/linux64.h (LINK_SHLIB_SPEC): Likewise.
	(LINK_OS_LINUX_SPEC32): Likewise.
	(LINK_OS_LINUX_SPEC64): Likewise.
	* config/rs6000/linux.h (LINK_SHLIB_SPEC): Likewise.
	(LINK_OS_LINUX_SPEC): Likewise.

From-SVN: r252735
parent 87f3a5cf
2017-09-13 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Add -static-pie
support.
(ENDFILE_LINUX_SPEC): Likewise.
(LINK_EH_SPEC): Likewise.
* config/rs6000/linux64.h (LINK_SHLIB_SPEC): Likewise.
(LINK_OS_LINUX_SPEC32): Likewise.
(LINK_OS_LINUX_SPEC64): Likewise.
* config/rs6000/linux.h (LINK_SHLIB_SPEC): Likewise.
(LINK_OS_LINUX_SPEC): Likewise.
2017-09-13 Martin Liska <mliska@suse.cz> 2017-09-13 Martin Liska <mliska@suse.cz>
PR middle-end/82154 PR middle-end/82154
......
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
#undef LINK_SHLIB_SPEC #undef LINK_SHLIB_SPEC
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
%{static-pie:-static -pie --no-dynamic-linker -z text}"
#undef LIB_DEFAULT_SPEC #undef LIB_DEFAULT_SPEC
#define LIB_DEFAULT_SPEC "%(lib_linux)" #define LIB_DEFAULT_SPEC "%(lib_linux)"
...@@ -93,8 +94,9 @@ ...@@ -93,8 +94,9 @@
#undef LINK_OS_LINUX_SPEC #undef LINK_OS_LINUX_SPEC
#define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \ #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \ %{!static-pie: \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" %{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}}"
/* For backward compatibility, we must continue to use the AIX /* For backward compatibility, we must continue to use the AIX
structure return convention. */ structure return convention. */
......
...@@ -395,7 +395,8 @@ extern int dot_symbols; ...@@ -395,7 +395,8 @@ extern int dot_symbols;
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)" #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)"
#undef LINK_SHLIB_SPEC #undef LINK_SHLIB_SPEC
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
%{static-pie:-static -pie --no-dynamic-linker -z text}"
#undef LIB_DEFAULT_SPEC #undef LIB_DEFAULT_SPEC
#define LIB_DEFAULT_SPEC "%(lib_linux)" #define LIB_DEFAULT_SPEC "%(lib_linux)"
...@@ -470,13 +471,15 @@ extern int dot_symbols; ...@@ -470,13 +471,15 @@ extern int dot_symbols;
#endif #endif
#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \ #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \ %{!static-pie: \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \ %{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
%(link_os_extra_spec32)" %(link_os_extra_spec32)"
#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \ #define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \ %{!static-pie: \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \ %{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
%(link_os_extra_spec64)" %(link_os_extra_spec64)"
#undef TOC_SECTION_ASM_OP #undef TOC_SECTION_ASM_OP
......
...@@ -764,11 +764,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) ...@@ -764,11 +764,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
"%{shared:; \ "%{shared:; \
pg|p|profile:gcrt1.o%s; \ pg|p|profile:gcrt1.o%s; \
static:crt1.o%s; \ static:crt1.o%s; \
" PIE_SPEC ":Scrt1.o%s; \ static-pie|" PIE_SPEC ":Scrt1.o%s; \
:crt1.o%s} \ :crt1.o%s} \
%{mnewlib:ecrti.o%s;:crti.o%s} \ %{mnewlib:ecrti.o%s;:crti.o%s} \
%{static:crtbeginT.o%s; \ %{static:crtbeginT.o%s; \
shared|" PIE_SPEC ":crtbeginS.o%s; \ shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
:crtbegin.o%s} \ :crtbegin.o%s} \
%{fvtable-verify=none:%s; \ %{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_start_preinit.o%s; \ fvtable-verify=preinit:vtv_start_preinit.o%s; \
...@@ -782,7 +782,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) ...@@ -782,7 +782,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
fvtable-verify=preinit:vtv_end_preinit.o%s; \ fvtable-verify=preinit:vtv_end_preinit.o%s; \
fvtable-verify=std:vtv_end.o%s} \ fvtable-verify=std:vtv_end.o%s} \
%{static:crtend.o%s; \ %{static:crtend.o%s; \
shared|" PIE_SPEC ":crtendS.o%s; \ shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
:crtend.o%s} \ :crtend.o%s} \
%{mnewlib:ecrtn.o%s;:crtn.o%s} \ %{mnewlib:ecrtn.o%s;:crtn.o%s} \
" CRTOFFLOADEND " CRTOFFLOADEND
...@@ -816,7 +816,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) ...@@ -816,7 +816,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
#if defined(HAVE_LD_EH_FRAME_HDR) #if defined(HAVE_LD_EH_FRAME_HDR)
# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " # define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
#endif #endif
#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
......
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