Properly handle indirect symbols
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Jul 2012 14:44:35 +0000 (14:44 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Jul 2012 14:44:35 +0000 (14:44 +0000)
commit90c984fc53ae23dcda0cba309ad4b51a9dd5d9ee
treea2dac07d507762cbaaa7f2a34d932618a2f8160d
parent3146fac42836137f284d541266ece045d56b5895
Properly handle indirect symbols

2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/3351
* elflink.c (_bfd_elf_update_dynamic_flags): New.
(_bfd_elf_merge_symbol): Update both real and indirect symbol
dynamic flags.
(_bfd_elf_add_default_symbol): Make the real symbol dynamic if
the indirect symbol is defined in a shared library.
(elf_link_add_object_symbols): Likewise.  If the indirect
symbol has been forced local, don't make the real symbol
dynamic.
(elf_link_check_versioned_symbol): Check indirect symbol.
(elf_link_output_extsym): Use real symbol definition when
reporting indirect symbol error.  Check version info for
dynamic versioned symbol.

2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/3351
* ld-elf/indirect.exp: New file.
* ld-elf/indirect1a.c: Likewise.
* ld-elf/indirect1b.c: Likewise.
* ld-elf/indirect1c.c: Likewise.
* ld-elf/indirect2.c: Likewise.
* ld-elf/indirect3.out: Likewise.
* ld-elf/indirect3a.c: Likewise.
* ld-elf/indirect3b.c: Likewise.
* ld-elf/indirect3c.c: Likewise.
* ld-elf/indirect4.out: Likewise.
* ld-elf/indirect4a.c: Likewise.
* ld-elf/indirect4b.c: Likewise.
* ld-elf/indirect4c.c: Likewise.
16 files changed:
bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog
ld/testsuite/ld-elf/indirect.exp [new file with mode: 0644]
ld/testsuite/ld-elf/indirect1a.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect1b.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect1c.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect2.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect3.out [new file with mode: 0644]
ld/testsuite/ld-elf/indirect3a.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect3b.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect3c.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect4.out [new file with mode: 0644]
ld/testsuite/ld-elf/indirect4a.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect4b.c [new file with mode: 0644]
ld/testsuite/ld-elf/indirect4c.c [new file with mode: 0644]