sync libiberty from gcc
[deliverable/binutils-gdb.git] / libiberty / simple-object-elf.c
index c62d5bba551c099e9f33c3a0b33dd4612952411c..7c9d492f6a42d32f921f65f7dac20139b4283d31 100644 (file)
@@ -1467,6 +1467,11 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
                       && st_shndx < shnum
                       && pfnret[st_shndx - 1] == -1)
                discard = 1;
+             /* We also need to remove global UNDEFs which can
+                cause link fails later.  */
+             else if (st_shndx == SHN_UNDEF
+                      && ELF_ST_BIND (*st_info) == STB_GLOBAL)
+               discard = 1;
 
              if (discard)
                {
This page took 0.022854 seconds and 4 git commands to generate.