ld: Keep indirect symbol from IR if referenced from shared object
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 11 Feb 2022 23:13:19 +0000 (15:13 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 14 Feb 2022 04:31:44 +0000 (20:31 -0800)
commit20ea3acc727f3be6322dfbd881e506873535231d
tree0971a9368c01ffa00043979203002b9be1e27c1d
parentbb88f104253172deca66cc113d1f47af64005804
ld: Keep indirect symbol from IR if referenced from shared object

Don't change indirect symbol defined in IR to undefined if it is
referenced from shared object.

bfd/

PR ld/28879
* elflink.c (_bfd_elf_merge_symbol): Don't change indirect
symbol defined in IR to undefined if it is referenced from
shared object.

ld/

PR ld/28879
* testsuite/ld-plugin/lto.exp: Run PR ld/28879 tests.
* testsuite/ld-plugin/pr28879a.cc: New file.
* testsuite/ld-plugin/pr28879b.cc: Likewise.
bfd/elflink.c
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/pr28879a.cc [new file with mode: 0644]
ld/testsuite/ld-plugin/pr28879b.cc [new file with mode: 0644]