aboutsummaryrefslogtreecommitdiff
blob: 121dec4cf694e8c8e834de19d5a1c288011844cf (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.c	2016-02-19 23:18:38.000000000 +0100
+++ b/gcc/gcc.c	2016-05-02 22:56:10.185721270 +0200
@@ -868,6 +868,12 @@ proper position among the other output f
 #endif
 #endif
 
+#ifdef EXTRA_OPTIONS
+#define LINK_NOW_SPEC "%{!nonow:-z now} "
+#else
+#define LINK_NOW_SPEC ""
+#endif
+
 #ifdef ENABLE_DEFAULT_PIE
 #define NO_PIE_SPEC		"no-pie|static"
 #define PIE_SPEC		NO_PIE_SPEC "|r|shared:;"
@@ -1013,7 +1020,7 @@ proper position among the other output f
     %(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:%{!nostartfiles:%S}} \