diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch | 47 |
1 files changed, 30 insertions, 17 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 6581bad119..53e30a0aaa 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,52 +1,68 @@ -From 5bcd884f8af5106d0fa380c42cffe07f3c993ed2 Mon Sep 17 00:00:00 2001 +From 257ad1ce148417e1cefe2332d8acc5c8216c2522 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 2 Mar 2015 01:58:54 +0000 -Subject: [PATCH 01/15] binutils-crosssdk: Generate relocatable SDKs +Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs This patch will modify the ELF linker scripts so that the crosssdk linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries will be relocated, at SDK install time, the interpreter path can be easily changed by the relocating script. +generate larger .interp section for gold linker as well + Upstream-Status: Inappropriate [SDK specific] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- + gold/layout.cc | 2 +- ld/genscripts.sh | 3 +++ ld/scripttempl/elf.sc | 4 ++-- - 2 files changed, 5 insertions(+), 2 deletions(-) + 3 files changed, 6 insertions(+), 3 deletions(-) +diff --git a/gold/layout.cc b/gold/layout.cc +index a27cb071c75..32b52890b39 100644 +--- a/gold/layout.cc ++++ b/gold/layout.cc +@@ -5032,7 +5032,7 @@ Layout::create_interp(const Target* target) + gold_assert(interp != NULL); + } + +- size_t len = strlen(interp) + 1; ++ size_t len = 4096; + + Output_section_data* odata = new Output_data_const(interp, len, 1); + diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 77ddbbc8f8..d789e77943 100755 +index 088417ef2d5..46a2db7005c 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh -@@ -310,6 +310,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}" +@@ -304,6 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}" LD_FLAG=r DATA_ALIGNMENT=${DATA_ALIGNMENT_r} DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" +PARTIAL_LINKING=" " - ( echo "/* Script for ld -r: link without relocation */" - . ${CUSTOMIZER_SCRIPT} - . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -@@ -318,10 +319,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" + ( echo "/* Script for -r */" + source_sh ${CUSTOMIZER_SCRIPT} + source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +@@ -312,10 +313,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} CONSTRUCTING=" " +PARTIAL_LINKING=" " - ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */" - . ${CUSTOMIZER_SCRIPT} - . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ( echo "/* Script for -Ur */" + source_sh ${CUSTOMIZER_SCRIPT} + source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu +unset PARTIAL_LINKING DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc -index bd7584120e..8bbe052d4b 100644 +index 29a8f0781d5..75e46f4adaf 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc -@@ -139,8 +139,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then +@@ -147,8 +147,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi fi @@ -57,6 +73,3 @@ index bd7584120e..8bbe052d4b 100644 fi if test -z "$PLT"; then IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" --- -2.20.1 - |