diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-08-07 05:04:21 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-08-07 05:04:35 -0700 |
commit | 6e33951edcbed1fd803beabcde2af3b252b92164 (patch) | |
tree | c7a0d6fc3c3d61e67ddbfa8a7afd8b76c619b735 /opcodes | |
parent | 060967202b8def804d9afccad343d2eaef8a81cf (diff) | |
download | gdb-6e33951edcbed1fd803beabcde2af3b252b92164.zip gdb-6e33951edcbed1fd803beabcde2af3b252b92164.tar.gz gdb-6e33951edcbed1fd803beabcde2af3b252b92164.tar.bz2 |
Properly merge hidden versioned symbol
The hidden versioned symbol can only be merged with the versioned
symbol with the same symbol version. _bfd_elf_merge_symbol should
check the symbol version before merging the new hidden versioned
symbol with the existing symbol. _bfd_elf_link_hash_copy_indirect can't
copy any references to the hidden versioned symbol. We need to
bind a symbol locally when linking executable if it is locally defined,
hidden versioned, not referenced by shared library and not exported.
bfd/
PR ld/18720
* elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
if the new symbol matches the existing one. The new hidden
versioned symbol matches the existing symbol if they have the
same symbol version. Update the existing symbol only if they
match.
(_bfd_elf_add_default_symbol): Update call to
_bfd_elf_merge_symbol.
(_bfd_elf_link_assign_sym_version): Don't set the hidden field
here.
(elf_link_add_object_symbols): Override a definition only if the
new symbol matches the existing one.
(_bfd_elf_link_hash_copy_indirect): Don't copy any references to
the hidden versioned symbol.
(elf_link_output_extsym): Bind a symbol locally when linking
executable if it is locally defined, hidden versioned, not
referenced by shared library and not exported. Turn on
VERSYM_HIDDEN only if the hidden vesioned symbol is defined
locally.
ld/testsuite/
PR ld/18720
* ld-elf/indirect.exp: Run tests for PR ld/18720.
* ld-elf/pr18720.out: New file.
* ld-elf/pr18720a.c: Likewise.
* ld-elf/pr18720b.c: Likewise.
* ld-elf/pr18720c.c: Likewise.
Diffstat (limited to 'opcodes')
0 files changed, 0 insertions, 0 deletions