b8cdd5
--- binutils.orig/bfd/elflink.c	2022-06-13 14:22:15.071831986 +0100
b8cdd5
+++ binutils-2.35.2/bfd/elflink.c	2022-06-13 14:26:37.386163819 +0100
b8cdd5
@@ -5226,10 +5226,12 @@ elf_link_add_object_symbols (bfd *abfd,
b8cdd5
 	  if (!add_needed
b8cdd5
 	      && matched
b8cdd5
 	      && definition
b8cdd5
+	      && h->root.type != bfd_link_hash_indirect
b8cdd5
 	      && ((dynsym
b8cdd5
 		   && h->ref_regular_nonweak)
b8cdd5
 		  || (old_bfd != NULL
b8cdd5
 		      && (old_bfd->flags & BFD_PLUGIN) != 0
b8cdd5
+		      && !info->lto_all_symbols_read
b8cdd5
 		      && bind != STB_WEAK)
b8cdd5
 		  || (h->ref_dynamic_nonweak
b8cdd5
 		      && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0