Blame SOURCES/gcc10-pr96385.patch

0714f1
2020-08-03  Richard Biener  <rguenther@suse.de>
0714f1
0714f1
	PR lto/96385
0714f1
libiberty/
0714f1
	* simple-object-elf.c
0714f1
	(simple_object_elf_copy_lto_debug_sections): Localize global
0714f1
	UNDEFs and reuse the prevailing name.
0714f1
0714f1
--- libiberty/simple-object-elf.c
0714f1
+++ libiberty/simple-object-elf.c
0714f1
@@ -1467,6 +1467,11 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
0714f1
 		       && st_shndx < shnum
0714f1
 		       && pfnret[st_shndx - 1] == -1)
0714f1
 		discard = 1;
0714f1
+	      /* We also need to remove global UNDEFs which can
0714f1
+		 cause link fails later.  */
0714f1
+	      else if (st_shndx == SHN_UNDEF
0714f1
+		       && ELF_ST_BIND (*st_info) == STB_GLOBAL)
0714f1
+		discard = 1;
0714f1
 
0714f1
 	      if (discard)
0714f1
 		{