nativesdk-qemu: fix SDK relocation issue

User mode emulation binaries are linked using a local linker script. The
nativesdk ones were not used and the resulting binaries did not have the
interp section resized. Hence, those binaries could not be relocated.

[YOCTO #3083]

(From OE-Core rev: da014e900adfe96f01290c5a8f5fb08e295ca204)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Laurentiu Palcu
2012-09-11 16:55:31 +03:00
committed by Saul Wold
parent dd3edc9fbb
commit aeb336516b
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
Upstream-Status: Inappropriate [SDK specific]
In order to be able to change the dynamic loader path when relocating
binaries, the interp section has to be made big enough to accomodate
the new path (4096 is the maximum path length in Linux).
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Index: qemu-1.2.0/i386.ld
===================================================================
--- qemu-1.2.0.orig/i386.ld
+++ qemu-1.2.0/i386.ld
@@ -8,7 +8,7 @@ SECTIONS
{
/* Read-only sections, merged into text segment: */
. = 0x60000000 + SIZEOF_HEADERS;
- .interp : { *(.interp) }
+ .interp : { *(.interp); . = 0x1000; }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
Index: qemu-1.2.0/x86_64.ld
===================================================================
--- qemu-1.2.0.orig/x86_64.ld
+++ qemu-1.2.0/x86_64.ld
@@ -6,7 +6,7 @@ SECTIONS
{
/* Read-only sections, merged into text segment: */
. = 0x60000000 + SIZEOF_HEADERS;
- .interp : { *(.interp) }
+ .interp : { *(.interp); . = 0x1000; }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }

View File

@@ -29,6 +29,12 @@ SRC_URI[sha256sum] = "7705b14d9b8e4df4a0b1790980e618084261e8daef0672a1aa7a830a0f
S = "${WORKDIR}/qemu-${PV}"
PR = "r1"
SRC_URI_append_virtclass-nativesdk = "\
file://relocatable_sdk.patch \
"
do_configure_prepend_virtclass-nativesdk() {
if [ "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "" ] ; then
# Undo the -lX11 added by linker-flags.patch