All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/3] binutils: Let crosssdk gold linker generate 4096 btyes long .interp section
@ 2020-08-20  8:01 Khem Raj
  2020-08-20  8:01 ` [PATCH V2 2/3] gcc-cross-canadian: Install gcc/g++ wrappers for musl Khem Raj
  2020-08-20  8:01 ` [PATCH V2 3/3] gcc-cross-canadian: Correct the regexp to delete versioned gcc binary Khem Raj
  0 siblings, 2 replies; 7+ messages in thread
From: Khem Raj @ 2020-08-20  8:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...s-crosssdk-Generate-relocatable-SDKs.patch | 26 +++++++++++++++----
 1 file 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 @@
-From b8d182865081d17549fb9a4b9bc3062b526caf65 Mon Sep 17 00:00:00 2001
+From a0b23b160d6cfa7be4437c6e623633d76395f2ad 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/17] binutils-crosssdk: Generate relocatable SDKs
+Subject: [PATCH 01/16] 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 13e533aaf21..b0afff16e2e 100644
+--- a/gold/layout.cc
++++ b/gold/layout.cc
+@@ -5019,7 +5019,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 03392d265c7..435689ea144 100755
 --- a/ld/genscripts.sh
@@ -43,10 +59,10 @@ index 03392d265c7..435689ea144 100755
  DATA_ALIGNMENT=${DATA_ALIGNMENT_}
  RELOCATING=" "
 diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
-index 0b8b32a4407..ee6b71075d7 100644
+index eb74743e5c3..c9a8a47615f 100644
 --- a/ld/scripttempl/elf.sc
 +++ b/ld/scripttempl/elf.sc
-@@ -140,8 +140,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
+@@ -143,8 +143,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
      DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
    fi
  fi
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-21 19:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20  8:01 [PATCH V2 1/3] binutils: Let crosssdk gold linker generate 4096 btyes long .interp section Khem Raj
2020-08-20  8:01 ` [PATCH V2 2/3] gcc-cross-canadian: Install gcc/g++ wrappers for musl Khem Raj
2020-08-20 21:07   ` Leon Woestenberg
2020-08-20 22:51     ` Khem Raj
2020-08-21 10:51   ` [OE-core] " Richard Purdie
2020-08-21 19:51     ` Khem Raj
2020-08-20  8:01 ` [PATCH V2 3/3] gcc-cross-canadian: Correct the regexp to delete versioned gcc binary Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.