From 112bcc0bebc8c3499acc67d04f292b3908e4fbcc Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 22 Feb 2014 21:01:52 +0100 Subject: [PATCH] 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 --- libdw/dwarf_begin_elf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.2