summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch
blob: a96e91339b00205576c52723c5adc92c36e1c4b2 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 44ef80688b56beea85c0070840dea1e2a4e34aed Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 13 Jun 2017 12:12:52 -0700
Subject: [PATCH 49/49] gcc: Enable static PIE

Static PIE support in GCC
see
https://gcc.gnu.org/ml/gcc/2015-06/msg00008.html

startfiles before patch:
 -static -> crt1.o crti.o crtbeginT.o
 -static -PIE -> crt1.o crti.o crtbeginT.o
 
after patch:
 -static -> crt1.o crti.o crtbeginT.o
 -static -PIE -> rcrt1.o crti.o crtbeginS.o
 
Upstream-Status: Pending

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>

---
 gcc/config/gnu-user.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index de605b0..b035bbe 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -52,11 +52,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define GNU_USER_TARGET_STARTFILE_SPEC \
   "%{shared:; \
      pg|p|profile:gcrt1.o%s; \
-     static:crt1.o%s; \
+     static: %{" PIE_SPEC ": rcrt1.o%s; :crt1.o%s}; \
      " PIE_SPEC ":Scrt1.o%s; \
      :crt1.o%s} \
    crti.o%s \
-   %{static:crtbeginT.o%s; \
+   %{static: %{" PIE_SPEC ": crtbeginS.o%s; :crtbeginT.o%s}; \
      shared|" PIE_SPEC ":crtbeginS.o%s; \
      :crtbegin.o%s} \
    %{fvtable-verify=none:%s; \

2.13.1