]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix elflint test for .eh_frame_hdr allocation.
authorUlrich Drepper <drepper@redhat.com>
Wed, 21 Jan 2009 21:05:36 +0000 (13:05 -0800)
committerUlrich Drepper <drepper@redhat.com>
Wed, 21 Jan 2009 21:05:36 +0000 (13:05 -0800)
src/ChangeLog
src/elflint.c

index 9a0774d0ee14edfc3c897d206d6307ecfa5cd283..9814eb8cc41acabafdb34e108392a1c6e224ca2b 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-21  Ulrich Drepper  <drepper@redhat.com>
+
+       * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
+       test.
+       (check_exception_data): First sanity test.
+
 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
 
        * readelf.c (print_debug_exception_table): Show target of ar_disp
index f31b75c1fce9f1177486fc7b25b8714d5d3bbb77..3beac4646a36c77e35f4d9bae50e49c5e93e43ef 100644 (file)
@@ -4223,7 +4223,7 @@ call frame search table size mismatch in program and section header\n"));
          if ((phdr->p_flags & PF_R) == 0)
            ERROR (gettext ("\
 call frame search table must be allocated\n"));
-         else if (shdr != NULL && (shdr->sh_flags & SHF_ALLOC) != 0)
+         else if (shdr != NULL && (shdr->sh_flags & SHF_ALLOC) == 0)
            ERROR (gettext ("\
 section [%2zu] '%s' must be allocated\n"), elf_ndxscn (scn), ".eh_frame_hdr");
 
@@ -4270,6 +4270,10 @@ static void
 check_exception_data (Ebl *ebl __attribute__ ((unused)),
                      GElf_Ehdr *ehdr __attribute__ ((unused)))
 {
+  if ((ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)
+      && pt_gnu_eh_frame_pndx == 0 && eh_frame_hdr_scnndx != 0)
+    ERROR (gettext ("executable/DSO with .eh_frame_hdr section does not have "
+                   "a PT_GNU_EH_FRAME program header entry"));
 }