]> code.ossystems Code Review - openembedded-core.git/commitdiff
binutils: relocatable SDK: change PT_INTERP section size
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Tue, 31 Jul 2012 08:49:34 +0000 (11:49 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Aug 2012 14:22:45 +0000 (15:22 +0100)
This patch is needed so that all SDK binaries have the PT_INTERP section
size set to 4096 (max path size in Linux) in order to be able to parse
the binaries later and change the interpreter to the path we want.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb
meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch [new file with mode: 0644]

index 0eb5684e81153b388d12f6af7ab5abe7baa3602e..c93654992a8d2fbc3977d193d40f3f9733140d36 100644 (file)
@@ -2,8 +2,13 @@ require binutils-cross_${PV}.bb
 
 inherit crosssdk
 
+PR = "r1"
+
 PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
 
+
+SRC_URI += "file://relocatable_sdk.patch"
+
 do_configure_prepend () {
        sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
 }
diff --git a/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch
new file mode 100644 (file)
index 0000000..33f9e68
--- /dev/null
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [SDK specific]
+
+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.
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: binutils-2.22/ld/scripttempl/elf.sc
+===================================================================
+--- binutils-2.22.orig/ld/scripttempl/elf.sc
++++ binutils-2.22/ld/scripttempl/elf.sc
+@@ -116,7 +116,7 @@ if test -n "${COMMONPAGESIZE}"; then
+   DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
+ fi
+ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
+-  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
++  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
+ fi
+ if test -z "$PLT"; then
+   IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"