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 | 36 |
1 files changed, 26 insertions, 10 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 3a9461bf4a..4ef11c56e7 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,6 +1,6 @@ -From c9aed4cb3c02715b2ba1fc70949043849f202f46 Mon Sep 17 00:00:00 2001 +From 089ee95b342e79af09258b45c888a13b35fadf26 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> -Date: Sun, 8 Dec 2019 00:31:35 -0800 +Date: Mon, 2 Mar 2015 01:58:54 +0000 Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs This patch will modify the ELF linker scripts so that the crosssdk @@ -8,33 +8,49 @@ linker will generate binaries with a 4096 bytes PT_INTERP section. When the bina 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 b43ae841a6c..6101a95195b 100644 +--- a/gold/layout.cc ++++ b/gold/layout.cc +@@ -5102,7 +5102,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 cb2b081e9e..db2e9fd569 100755 +index d6ceb3fe4f5..365c0e778cc 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh -@@ -325,6 +325,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}" +@@ -298,6 +298,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 */" + ( echo "/* Script for -r */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -@@ -333,10 +334,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" +@@ -306,10 +307,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 */" + ( echo "/* Script for -Ur */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu @@ -43,10 +59,10 @@ index cb2b081e9e..db2e9fd569 100755 DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc -index f9f0f7d402..9e469dca86 100644 +index fae7c2ad71c..7fe37eb1874 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc -@@ -140,8 +140,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then +@@ -150,8 +150,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi fi |