]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elflint: Allow PT_GNU_EH_FRAME segment to match SHT_X86_64_UNWIND section.
authorMark Wielaard <mark@klomp.org>
Sat, 10 Nov 2018 22:33:03 +0000 (23:33 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 13 Nov 2018 21:16:26 +0000 (22:16 +0100)
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>
src/ChangeLog
src/elflint.c

index 7eecfcb5cf81f7ffaa9f6b8119b777fa846a25ec..803ac95fbb296c3abc565bcf78aa7a7b3ab3f9dc 100644 (file)
@@ -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
index 184ca125919602e823fcb499a48dfd96f366ea6b..810c8bd7f3372b8c1a0c63dc36ca5f540ec2ba22 100644 (file)
@@ -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)))