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 /bfd | |
parent | ld: Run pr23189 for all targets (diff) | |
download | binutils-gdb-97373b2eba6077d5059370a95931b93a8b118813.tar.gz binutils-gdb-97373b2eba6077d5059370a95931b93a8b118813.tar.bz2 binutils-gdb-97373b2eba6077d5059370a95931b93a8b118813.zip |
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 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elfxx-x86.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index cc8773cb144..bab543b9cef 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2018-05-18 H.J. Lu <hongjiu.lu@intel.com> + + 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. + 2018-05-18 Kito Cheng <kito.cheng@gmail.com> * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index f4dbddf15e3..29d92d288ac 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -2048,8 +2048,11 @@ _bfd_x86_elf_link_symbol_references_local (struct bfd_link_info *info, } /* Symbols created by HIDDEN and PROVIDE_HIDDEN assignments in linker - script aren't forced local here yet. */ - if (!h->root.ldscript_def) + script aren't forced local here yet. bfd_hide_sym_by_version + can't be used to check if a versioned symbol is hidden. It has to + be syncd with _bfd_elf_link_assign_sym_version to get the correct + answer. */ + if (!h->root.ldscript_def && h->versioned == unversioned) eh->local_ref = 1; return FALSE; |