aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-02-04 13:56:34 +1030
committerAlan Modra <amodra@gmail.com>2021-02-04 14:09:51 +1030
commit7d409ac001cce916661d345bff01ed589991e762 (patch)
tree54fd12705df6bf79810fd58f3fe6ca566891da0d /bfd
parente3714e037b711bb5ed794dbfe2064aa4f8ff252c (diff)
downloadgdb-7d409ac001cce916661d345bff01ed589991e762.zip
gdb-7d409ac001cce916661d345bff01ed589991e762.tar.gz
gdb-7d409ac001cce916661d345bff01ed589991e762.tar.bz2
PR27311, (symbol from plugin): undefined reference, hidden sym
bfd/ PR 27311 * elflink.c (elf_link_add_object_symbols): Don't pull in as-needed libraries for IR references on pass over libraries after LTO recompilation. ld/ * testsuite/ld-plugin/pr27311d.c: New test. * testsuite/ld-plugin/lto.exp: Rename pr27311 to pr27311-1, compile and link new test as pr27311-2.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elflink.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 99987a2..d40aa50 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2021-02-04 Alan Modra <amodra@gmail.com>
+
+ PR 27311
+ * elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
+ libraries for IR references on pass over libraries after LTO
+ recompilation.
+
2021-02-03 Alan Modra <amodra@gmail.com>
PR 27311
diff --git a/bfd/elflink.c b/bfd/elflink.c
index b8c2925..291cec0 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -5279,6 +5279,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
&& h->ref_regular_nonweak)
|| (old_bfd != NULL
&& (old_bfd->flags & BFD_PLUGIN) != 0
+ && !info->lto_all_symbols_read
&& bind != STB_WEAK)
|| (h->ref_dynamic_nonweak
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0