From 1963f60adb1ea775220cc92e0c644bbb59ad3191 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 28 Aug 2017 13:14:28 +0000 Subject: [PATCH] re PR lto/81968 (early lto debug objects make Solaris ld SEGV) 2017-08-28 Richard Biener 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 | 7 +++++++ libiberty/simple-object-elf.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index f5c3069736a..58d2816a141 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,10 @@ +2017-08-28 Richard Biener + + 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 PR lto/81925 diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c index 10bf5e785e5..ee7a38cf80e 100644 --- a/libiberty/simple-object-elf.c +++ b/libiberty/simple-object-elf.c @@ -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); } -- 2.30.2