diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-05-18 14:23:41 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-05-18 14:34:49 -0700 |
commit | 97373b2eba6077d5059370a95931b93a8b118813 (patch) | |
tree | 299609e5c161b68ae98cb1c21858f4096292cd6e /ld/testsuite/ld-i386 | |
parent | 941036f4ffb95a553fd1a0c44313d72ddcf5cbf0 (diff) |
x86: Don't set eh->local_ref to 1 for versioned symbol
bfd_hide_sym_by_version can't be used to check if a versioned symbol is
hidden. It has to be synced with _bfd_elf_link_assign_sym_version to
get the correct answer.
bfd/
PR ld/23194
* elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
set eh->local_ref to 1 if a symbol is versioned and there is a
version script.
ld/
PR ld/23194
* testsuite/ld-i386/i386.exp: Run pr23194.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr23194.d: New file.
* testsuite/ld-i386/pr23194.map: Likewise.
* testsuite/ld-i386/pr23194.s: Likewise.
* testsuite/ld-x86-64/pr23194.d: Likewise.
* testsuite/ld-x86-64/pr23194.map: Likewise.
* testsuite/ld-x86-64/pr23194.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r-- | ld/testsuite/ld-i386/i386.exp | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/pr23194.d | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/pr23194.map | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/pr23194.s | 12 |
4 files changed, 26 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 5683a75208..bb91a760ca 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -459,6 +459,7 @@ run_dump_test "pr22135" run_dump_test "pr22782" run_dump_test "pr22929" run_dump_test "pr23189" +run_dump_test "pr23194" if { !([istarget "i?86-*-linux*"] || [istarget "i?86-*-gnu*"] diff --git a/ld/testsuite/ld-i386/pr23194.d b/ld/testsuite/ld-i386/pr23194.d new file mode 100644 index 0000000000..b5e8c3330e --- /dev/null +++ b/ld/testsuite/ld-i386/pr23194.d @@ -0,0 +1,7 @@ +#as: --32 -mrelax-relocations=yes +#ld: -shared -melf_i386 --version-script pr23194.map +#readelf: -r --wide + +Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 1 entry: + Offset Info Type Sym. Value Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_RELATIVE + diff --git a/ld/testsuite/ld-i386/pr23194.map b/ld/testsuite/ld-i386/pr23194.map new file mode 100644 index 0000000000..353c194af5 --- /dev/null +++ b/ld/testsuite/ld-i386/pr23194.map @@ -0,0 +1,6 @@ +FOO { + global: + bar; + local: + *; +}; diff --git a/ld/testsuite/ld-i386/pr23194.s b/ld/testsuite/ld-i386/pr23194.s new file mode 100644 index 0000000000..32693feb7f --- /dev/null +++ b/ld/testsuite/ld-i386/pr23194.s @@ -0,0 +1,12 @@ + .text + .symver foo,foo@FOO + .globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .globl bar + .type bar, @function +bar: + jmp *foo@GOT(%eax) + .size bar, .-bar |