]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix abort() on missing section headers.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 22 Feb 2014 20:01:52 +0000 (21:01 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 22 Feb 2014 20:16:48 +0000 (21:16 +0100)
libdw/
2014-02-22  Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix abort() on missing section headers.
* dwarf_begin_elf.c (check_section): Replace abort call by a return;

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
libdw/dwarf_begin_elf.c

index 6cf3aa17855df880e879c6881285bbcf43f15114..b3a9dde76d4eec9ae228b7d465a7fb4c8efecb9e 100644 (file)
@@ -187,9 +187,9 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
   /* Get the section header data.  */
   shdr = gelf_getshdr (scn, &shdr_mem);
   if (shdr == NULL)
-    /* This should never happen.  If it does something is
-       wrong in the libelf library.  */
-    abort ();
+    /* We may read /proc/PID/mem with only program headers mapped and section
+       headers out of the mapped pages.  */
+    return result;
 
   /* Ignore any SHT_NOBITS sections.  Debugging sections should not
      have been stripped, but in case of a corrupt file we won't try