From: Mark Wielaard Date: Sat, 10 Nov 2018 22:33:03 +0000 (+0100) Subject: elflint: Allow PT_GNU_EH_FRAME segment to match SHT_X86_64_UNWIND section. X-Git-Tag: elfutils-0.175~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22ec8efc1dd87cdc7892523457eb55990b967224;p=thirdparty%2Felfutils.git elflint: Allow PT_GNU_EH_FRAME segment to match SHT_X86_64_UNWIND section. The gold linker might generate an .eh_frame_hdr with a SHT_X86_64_UNWIND type instead of a SHT_PROGBITS type. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 7eecfcb5c..803ac95fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2018-11-10 Mark Wielaard + + * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment + to be matched against SHT_X86_64_UNWIND section. + 2018-11-09 Mark Wielaard * strip.c (remove_debug_relocations): Check if section is gnu diff --git a/src/elflint.c b/src/elflint.c index 184ca1259..810c8bd7f 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -4633,8 +4633,10 @@ program header offset in ELF header and PHDR entry do not match")); any = true; shdr = gelf_getshdr (scn, &shdr_mem); if (shdr != NULL - && shdr->sh_type == (is_debuginfo - ? SHT_NOBITS : SHT_PROGBITS) + && ((is_debuginfo && shdr->sh_type == SHT_NOBITS) + || (! is_debuginfo + && (shdr->sh_type == SHT_PROGBITS + || shdr->sh_type == SHT_X86_64_UNWIND))) && elf_strptr (ebl->elf, shstrndx, shdr->sh_name) != NULL && ! strcmp (".eh_frame_hdr", elf_strptr (ebl->elf, shstrndx, shdr->sh_name)))