diff options
author | Mark Wielaard <mark@klomp.org> | 2018-11-10 23:33:03 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-11-13 22:16:26 +0100 |
commit | 22ec8efc1dd87cdc7892523457eb55990b967224 (patch) | |
tree | e2b1092f7ff74b3574ee87af141bb7d141dcaf09 | |
parent | cf10453f8252df81225796d98548ba6eac113df3 (diff) |
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 <mark@klomp.org>
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/elflint.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7eecfcb5..803ac95f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2018-11-10 Mark Wielaard <mark@klomp.org> + + * 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 <mark@klomp.org> * strip.c (remove_debug_relocations): Check if section is gnu diff --git a/src/elflint.c b/src/elflint.c index 184ca125..810c8bd7 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))) |