summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2014-02-22 21:01:52 +0100
committerJan Kratochvil <jan.kratochvil@redhat.com>2014-02-22 21:16:48 +0100
commit112bcc0bebc8c3499acc67d04f292b3908e4fbcc (patch)
treea206c43a8f9af6aae042e4cc70c84ff4e4929de0
parent45c85fe5df4559b1e8bb8f5bbf9093160dcec449 (diff)
downloadelfutils-112bcc0bebc8c3499acc67d04f292b3908e4fbcc.tar.gz
Fix abort() on missing section headers.
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>
-rw-r--r--libdw/dwarf_begin_elf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 6cf3aa17..b3a9dde7 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