From: Jan Kratochvil Date: Sat, 22 Feb 2014 20:01:52 +0000 (+0100) Subject: Fix abort() on missing section headers. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=112bcc0bebc8c3499acc67d04f292b3908e4fbcc;p=thirdparty%2Felfutils.git Fix abort() on missing section headers. libdw/ 2014-02-22 Jan Kratochvil Fix abort() on missing section headers. * dwarf_begin_elf.c (check_section): Replace abort call by a return; Signed-off-by: Jan Kratochvil --- diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c index 6cf3aa178..b3a9dde76 100644 --- a/libdw/dwarf_begin_elf.c +++ b/libdw/dwarf_begin_elf.c @@ -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