diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-02-11 15:13:19 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-02-13 20:31:44 -0800 |
commit | 20ea3acc727f3be6322dfbd881e506873535231d (patch) | |
tree | 0971a9368c01ffa00043979203002b9be1e27c1d /bfd | |
parent | bb88f104253172deca66cc113d1f47af64005804 (diff) | |
download | gdb-20ea3acc727f3be6322dfbd881e506873535231d.zip gdb-20ea3acc727f3be6322dfbd881e506873535231d.tar.gz gdb-20ea3acc727f3be6322dfbd881e506873535231d.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elflink.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 6fa18d9..f852142 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1294,9 +1294,8 @@ _bfd_elf_merge_symbol (bfd *abfd, h->root.non_ir_ref_dynamic = true; hi->root.non_ir_ref_dynamic = true; } - - if ((oldbfd->flags & BFD_PLUGIN) != 0 - && hi->root.type == bfd_link_hash_indirect) + else if ((oldbfd->flags & BFD_PLUGIN) != 0 + && hi->root.type == bfd_link_hash_indirect) { /* Change indirect symbol from IR to undefined. */ hi->root.type = bfd_link_hash_undefined; |