summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Tian <kevin.tian@intel.com>2010-07-15 10:22:09 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-15 10:22:09 +0100
commit0f19ae1b00edd8238d25df99643f9d5a6f9a564a (patch)
tree6dba74fc3355c11cddbc685e5632acd11b70313c
parentbaf69e6a929344368284128038959228e073ed7a (diff)
downloadpoky-0f19ae1b00edd8238d25df99643f9d5a6f9a564a.tar.gz
binutils-cross: fix '-fPIE' on mips platform
Current binutils generates problematic relocation table for executable compiled with '-fPIE', such as dbus-daemon. That way ld.so.1 falls into segmentation fault when accessing bad reloc entry. This pulls back one fix from binutils CVS repo (1.267) to add PIE support back. Signed-off-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--meta/packages/binutils/binutils-2.20.1/binutils-mips-pie.patch29
-rw-r--r--meta/packages/binutils/binutils_2.20.1.bb1
2 files changed, 30 insertions, 0 deletions
diff --git a/meta/packages/binutils/binutils-2.20.1/binutils-mips-pie.patch b/meta/packages/binutils/binutils-2.20.1/binutils-mips-pie.patch
new file mode 100644
index 0000000000..c71f0ad4db
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20.1/binutils-mips-pie.patch
@@ -0,0 +1,29 @@
1# "-fPIE" always triggers segmentation fault in ld.so.1 on mips platform,
2# which was first saw on dbus-daemon. Below borrow the binutils fix from
3# binutils bugzilla:
4#
5# http://sourceware.org/bugzilla/show_bug.cgi?id=10858
6#
7# Its commit message says:
8# * elfxx-mips.c (mips_elf_create_dynamic_relocation): Use section
9# sym dynindx for relocs against defined syms in PIEs.
10#
11# It's in upstream CVS now (rev 1.267), but not in current release
12#
13# By Kevin Tian <kevin.tian@intel.com>, 2010-07-15
14
15diff --git a/elfxx-mips.c b/elfxx-mips.c
16index 3a1c8ba..f6c2c1c 100644
17--- binutils-2.20.1.orig/bfd/elfxx-mips.c
18+++ binutils-2.20.1/bfd/elfxx-mips.c
19@@ -5688,9 +5688,7 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
20
21 /* We must now calculate the dynamic symbol table index to use
22 in the relocation. */
23- if (h != NULL
24- && (!h->root.def_regular
25- || (info->shared && !info->symbolic && !h->root.forced_local)))
26+ if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
27 {
28 indx = h->root.dynindx;
29 if (SGI_COMPAT (output_bfd))
diff --git a/meta/packages/binutils/binutils_2.20.1.bb b/meta/packages/binutils/binutils_2.20.1.bb
index 2c67844eb9..3197b5efb3 100644
--- a/meta/packages/binutils/binutils_2.20.1.bb
+++ b/meta/packages/binutils/binutils_2.20.1.bb
@@ -24,6 +24,7 @@ SRC_URI = "\
24 file://binutils-uclibc-300-012_check_ldrunpath_length.patch \ 24 file://binutils-uclibc-300-012_check_ldrunpath_length.patch \
25 file://binutils-uclibc-gas-needs-libm.patch \ 25 file://binutils-uclibc-gas-needs-libm.patch \
26 file://binutils-x86_64_i386_biarch.patch \ 26 file://binutils-x86_64_i386_biarch.patch \
27 file://binutils-mips-pie.patch \
27 " 28 "
28 29
29# powerpc patches 30# powerpc patches