re PR lto/81968 (early lto debug objects make Solaris ld SEGV)
authorRichard Biener <rguenther@suse.de>
Mon, 28 Aug 2017 13:14:28 +0000 (13:14 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 28 Aug 2017 13:14:28 +0000 (13:14 +0000)
2017-08-28  Richard Biener  <rguenther@suse.de>

PR lto/81968
* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
Adjust field with for sh_type write, set SHF_EXCLUDE only for
removed sections.

From-SVN: r251384

libiberty/ChangeLog
libiberty/simple-object-elf.c

index f5c3069736a7fcca54c39c8f09daba95737a8fd1..58d2816a1416c36ea969285acfc48d1a44f7f1de 100644 (file)
@@ -1,3 +1,10 @@
+2017-08-28  Richard Biener  <rguenther@suse.de>
+
+       PR lto/81968
+       * simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
+       Adjust field with for sh_type write, set SHF_EXCLUDE only for
+       removed sections.
+
 2017-08-22  Richard Biener  <rguenther@suse.de>
 
        PR lto/81925
index 10bf5e785e5ce60cbe7d93c662aaf432c9d01871..ee7a38cf80eafd699455f43134a7d0df6ac6530c 100644 (file)
@@ -1382,7 +1382,7 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
             unused.  That allows the link editor to remove it in a partial
             link.  */
          ELF_SET_FIELD (type_functions, ei_class, Shdr,
-                        shdr, sh_type, Elf_Addr, SHT_NULL);
+                        shdr, sh_type, Elf_Word, SHT_NULL);
        }
 
       flags = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
@@ -1390,7 +1390,7 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
       if (ret == 0)
        flags &= ~SHF_EXCLUDE;
       else if (ret == -1)
-       flags |= SHF_EXCLUDE;
+       flags = SHF_EXCLUDE;
       ELF_SET_FIELD (type_functions, ei_class, Shdr,
                     shdr, sh_flags, Elf_Addr, flags);
     }