summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/fix-pr2404.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/fix-pr2404.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch b/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch
new file mode 100644
index 0000000000..41f35046fa
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch
@@ -0,0 +1,76 @@
1From: H.J. Lu <hjl.tools@gmail.com>
2Date: Tue, 21 Jan 2014 13:33:48 +0000 (-0800)
3Subject: Don't check shared/export_dynamic/ref_dynamic for type mismatch
4X-Git-Tag: hjl/linux/release/2.24.51.0.3~1^2~8^2~22
5X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=22ef172a21663abb477d72284b4d59c8eabcbb82
6
7Don't check shared/export_dynamic/ref_dynamic for type mismatch
8
9There is nothing linker can do when a type mismatched default definition
10are made dynamic by info->shared, info->export_dynamic or h->ref_dynamic.
11But we do want to avoid exporting it when building PIE. Let's remove
12those checks.
13
14bfd/
15
16 PR ld/2404
17 * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared,
18 info->export_dynamic, nor !h->ref_dynamic for type mismatch when
19 adding the default version.
20
21ld/testsuite/
22
23 PR ld/2404
24 * ld-elf/shared.exp: Add a PIE test for PR ld/2404.
25
26Upstream-Status: Backport
27---
28
29Index: binutils-2.24/bfd/elflink.c
30===================================================================
31--- binutils-2.24.orig/bfd/elflink.c 2014-02-08 13:20:08.628378267 +0000
32+++ binutils-2.24/bfd/elflink.c 2014-02-08 13:20:08.624378267 +0000
33@@ -1090,9 +1090,6 @@
34 the type of existing regular definition mismatch. We only do it
35 if the existing regular definition won't be dynamic. */
36 if (pold_alignment == NULL
37- && !info->shared
38- && !info->export_dynamic
39- && !h->ref_dynamic
40 && newdyn
41 && newdef
42 && !olddyn
43Index: binutils-2.24/ld/testsuite/ld-elf/shared.exp
44===================================================================
45--- binutils-2.24.orig/ld/testsuite/ld-elf/shared.exp 2014-02-08 13:20:08.628378267 +0000
46+++ binutils-2.24/ld/testsuite/ld-elf/shared.exp 2014-02-08 13:20:08.624378267 +0000
47@@ -432,3 +432,29 @@
48
49 run_cc_link_tests $build_cxx_tests
50 run_ld_link_exec_tests [] $run_cxx_tests
51+
52+if { [istarget *-*-linux*]
53+ || [istarget *-*-nacl*]
54+ || [istarget *-*-gnu*] } {
55+ run_cc_link_tests [list \
56+ [list \
57+ "Build libpr2404b.a with PIE" \
58+ "" \
59+ "-fPIE" \
60+ { pr2404b.c } \
61+ {} \
62+ "libpr2404b.a" \
63+ ] \
64+ ]
65+ run_ld_link_exec_tests [] [list \
66+ [list \
67+ "Run pr2404 with PIE" \
68+ "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
69+ "" \
70+ { dummy.c } \
71+ "pr2404pie" \
72+ "pr2404.out" \
73+ "-fPIE" \
74+ ] \
75+ ]
76+}