summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-08-20 01:01:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-21 14:29:10 +0100
commitf809d27e292c7c87083ca17f06d34dd504dfd1f5 (patch)
tree1834c3b5c7d0ca965ad4967c5142da474ca6a7d2 /meta/recipes-devtools
parent5731777f62b340d3c0c300da5a0290153e0fc10c (diff)
downloadpoky-f809d27e292c7c87083ca17f06d34dd504dfd1f5.tar.gz
binutils: Let crosssdk gold linker generate 4096 btyes long .interp section
When gold is used as default linker in crosssdk e.g. when building SDK binaries with LTO, the binaries do not have large enough .interp section size and SDK relocation fails for those nativesdk binaries and libraries which used gold for linking. This patch extends the .interp relaxation fix to gold (From OE-Core rev: f856b5f38263251bc48af8ba0da3385c09663d38) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch26
1 files changed, 21 insertions, 5 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch b/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
index 0e62d47616..4c1d11291b 100644
--- a/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
+++ b/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
@@ -1,22 +1,38 @@
1From b8d182865081d17549fb9a4b9bc3062b526caf65 Mon Sep 17 00:00:00 2001 1From a0b23b160d6cfa7be4437c6e623633d76395f2ad Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 2 Mar 2015 01:58:54 +0000 3Date: Mon, 2 Mar 2015 01:58:54 +0000
4Subject: [PATCH 01/17] binutils-crosssdk: Generate relocatable SDKs 4Subject: [PATCH 01/16] binutils-crosssdk: Generate relocatable SDKs
5 5
6This patch will modify the ELF linker scripts so that the crosssdk 6This patch will modify the ELF linker scripts so that the crosssdk
7linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries 7linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
8will be relocated, at SDK install time, the interpreter path can be easily 8will be relocated, at SDK install time, the interpreter path can be easily
9changed by the relocating script. 9changed by the relocating script.
10 10
11generate larger .interp section for gold linker as well
12
11Upstream-Status: Inappropriate [SDK specific] 13Upstream-Status: Inappropriate [SDK specific]
12 14
13Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> 15Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
14Signed-off-by: Khem Raj <raj.khem@gmail.com> 16Signed-off-by: Khem Raj <raj.khem@gmail.com>
15--- 17---
18 gold/layout.cc | 2 +-
16 ld/genscripts.sh | 3 +++ 19 ld/genscripts.sh | 3 +++
17 ld/scripttempl/elf.sc | 4 ++-- 20 ld/scripttempl/elf.sc | 4 ++--
18 2 files changed, 5 insertions(+), 2 deletions(-) 21 3 files changed, 6 insertions(+), 3 deletions(-)
19 22
23diff --git a/gold/layout.cc b/gold/layout.cc
24index 13e533aaf21..b0afff16e2e 100644
25--- a/gold/layout.cc
26+++ b/gold/layout.cc
27@@ -5019,7 +5019,7 @@ Layout::create_interp(const Target* target)
28 gold_assert(interp != NULL);
29 }
30
31- size_t len = strlen(interp) + 1;
32+ size_t len = 4096;
33
34 Output_section_data* odata = new Output_data_const(interp, len, 1);
35
20diff --git a/ld/genscripts.sh b/ld/genscripts.sh 36diff --git a/ld/genscripts.sh b/ld/genscripts.sh
21index 03392d265c7..435689ea144 100755 37index 03392d265c7..435689ea144 100755
22--- a/ld/genscripts.sh 38--- a/ld/genscripts.sh
@@ -43,10 +59,10 @@ index 03392d265c7..435689ea144 100755
43 DATA_ALIGNMENT=${DATA_ALIGNMENT_} 59 DATA_ALIGNMENT=${DATA_ALIGNMENT_}
44 RELOCATING=" " 60 RELOCATING=" "
45diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc 61diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
46index 0b8b32a4407..ee6b71075d7 100644 62index eb74743e5c3..c9a8a47615f 100644
47--- a/ld/scripttempl/elf.sc 63--- a/ld/scripttempl/elf.sc
48+++ b/ld/scripttempl/elf.sc 64+++ b/ld/scripttempl/elf.sc
49@@ -140,8 +140,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then 65@@ -143,8 +143,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
50 DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" 66 DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
51 fi 67 fi
52 fi 68 fi