--- binutils.orig/bfd/elflink.c 2022-06-13 14:22:15.071831986 +0100 +++ binutils-2.35.2/bfd/elflink.c 2022-06-13 14:26:37.386163819 +0100 @@ -5226,10 +5226,12 @@ elf_link_add_object_symbols (bfd *abfd, if (!add_needed && matched && definition + && h->root.type != bfd_link_hash_indirect && ((dynsym && 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