blob: 8874b3246a5738493399bee39b5811b6c267e541 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
On Hardened we add some options like -z now
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1001,6 +1001,12 @@ proper position among the other output files. */
#endif
#endif
+#ifdef EXTRA_OPTIONS
+#define LINK_NOW_SPEC "%{!nonow:-z now} "
+#else
+#define LINK_NOW_SPEC ""
+#endif
+
#ifdef ENABLE_DEFAULT_PIE
#define PIE_SPEC "!no-pie"
#define NO_FPIE1_SPEC "fno-pie"
@@ -1161,7 +1167,7 @@ proper position among the other output files. */
%(linker) " \
LINK_PLUGIN_SPEC \
"%{flto|flto=*:%<fcompare-debug*} \
- %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
+ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC LINK_NOW_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|