summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2012-11-21 16:57:42 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-24 15:12:29 +0000
commitf862f06f32d1e95c8071d4845684c77cf124ab55 (patch)
tree80cb1b58c26a206d32bef52758923fa05b089ed7 /meta
parente2143b373983fd3e85d78dc9b34cd386ceccc285 (diff)
downloadpoky-f862f06f32d1e95c8071d4845684c77cf124ab55.tar.gz
binutils-crosssdk: do not set .interp size to 0x1000 for partial linked objects
When building the SDK, the final .interp section size should be set to a bigger value (0x1000) in order to be able to change the dynamic loader's path later. However, we shouldn't do that for partial linked objects (when -r or -rU is used). That's because those objects will then have an .interp section of 0x1000 even if it contains no data and when the final linking is done we will end up with a "cannot move location counter backwards" error. That's because the linker will try to squeeze all the data in the .interp sections found in various partial linked objects into one 0x1000 bytes final .interp section. [YOCTO #3264] (From OE-Core rev: b25d0c5fe286e44ded46aefdcbe35ed259087759) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch37
1 files changed, 32 insertions, 5 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch
index 33f9e68b5f..7408c31aad 100644
--- a/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch
+++ b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch
@@ -7,15 +7,42 @@ by the relocating script.
7 7
8Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> 8Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
9 9
10Index: binutils-2.22/ld/scripttempl/elf.sc 10Index: binutils_git/ld/genscripts.sh
11=================================================================== 11===================================================================
12--- binutils-2.22.orig/ld/scripttempl/elf.sc 12--- binutils_git.orig/ld/genscripts.sh 2012-11-21 11:58:23.325441925 +0200
13+++ binutils-2.22/ld/scripttempl/elf.sc 13+++ binutils_git/ld/genscripts.sh 2012-11-21 12:03:42.106815400 +0200
14@@ -116,7 +116,7 @@ if test -n "${COMMONPAGESIZE}"; then 14@@ -290,6 +290,7 @@
15 LD_FLAG=r
16 DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
17 DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
18+PARTIAL_LINKING=" "
19 ( echo "/* Script for ld -r: link without relocation */"
20 . ${CUSTOMIZER_SCRIPT}
21 . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
22@@ -298,10 +299,12 @@
23 LD_FLAG=u
24 DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
25 CONSTRUCTING=" "
26+PARTIAL_LINKING=" "
27 ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
28 . ${CUSTOMIZER_SCRIPT}
29 . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
30 ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu
31+unset PARTIAL_LINKING
32
33 LD_FLAG=
34 DATA_ALIGNMENT=${DATA_ALIGNMENT_}
35Index: binutils_git/ld/scripttempl/elf.sc
36===================================================================
37--- binutils_git.orig/ld/scripttempl/elf.sc 2012-11-21 12:02:26.800377384 +0200
38+++ binutils_git/ld/scripttempl/elf.sc 2012-11-21 12:04:16.166109621 +0200
39@@ -124,8 +124,8 @@
40 DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
15 DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" 41 DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
16 fi 42 fi
17 if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then 43-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
18- INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" 44- INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
45+if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then
19+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }" 46+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
20 fi 47 fi
21 if test -z "$PLT"; then 48 if test -z "$PLT"; then