diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2012-07-31 11:49:34 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-02 15:28:38 +0100 |
commit | 77973e3004b9d3e2d5a59715e30d46e9351d0008 (patch) | |
tree | 2072624f88f788978e31e5dfe961237ca559e939 | |
parent | e81441a92fff59d617f22387716f6c1a9da5a9af (diff) | |
download | poky-77973e3004b9d3e2d5a59715e30d46e9351d0008.tar.gz |
binutils: relocatable SDK: change PT_INTERP section size
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.
(From OE-Core rev: 9bf657bbdfe7c1a9dff1cc121eab496e3e407197)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb | 5 | ||||
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb index 0eb5684e81..c93654992a 100644 --- a/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb +++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.22.bb | |||
@@ -2,8 +2,13 @@ require binutils-cross_${PV}.bb | |||
2 | 2 | ||
3 | inherit crosssdk | 3 | inherit crosssdk |
4 | 4 | ||
5 | PR = "r1" | ||
6 | |||
5 | PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk" | 7 | PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk" |
6 | 8 | ||
9 | |||
10 | SRC_URI += "file://relocatable_sdk.patch" | ||
11 | |||
7 | do_configure_prepend () { | 12 | do_configure_prepend () { |
8 | sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt | 13 | sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt |
9 | } | 14 | } |
diff --git a/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch new file mode 100644 index 0000000000..33f9e68b5f --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | Upstream-Status: Inappropriate [SDK specific] | ||
2 | |||
3 | This patch will modify the ELF linker scripts so that the crosssdk linker will | ||
4 | generate binaries with a 4096 bytes PT_INTERP section. When the binaries will | ||
5 | be relocated, at SDK install time, the interpreter path can be easily changed | ||
6 | by the relocating script. | ||
7 | |||
8 | Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
9 | |||
10 | Index: binutils-2.22/ld/scripttempl/elf.sc | ||
11 | =================================================================== | ||
12 | --- binutils-2.22.orig/ld/scripttempl/elf.sc | ||
13 | +++ binutils-2.22/ld/scripttempl/elf.sc | ||
14 | @@ -116,7 +116,7 @@ if test -n "${COMMONPAGESIZE}"; then | ||
15 | DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" | ||
16 | fi | ||
17 | if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then | ||
18 | - INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" | ||
19 | + INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }" | ||
20 | fi | ||
21 | if test -z "$PLT"; then | ||
22 | IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" | ||