summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_begin_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdw/dwarf_begin_elf.c')
-rw-r--r--libdw/dwarf_begin_elf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index e6ead614..aaac3999 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -97,6 +97,11 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
wrong in the libelf library. */
abort ();
+ /* Ignore any SHT_NOBITS sections. Debugging sections should not
+ have been stripped, but in case of a corrupt file we won't try
+ to look at the missing data. */
+ if (unlikely (shdr->sh_type == SHT_NOBITS))
+ return result;
/* Make sure the section is part of a section group only iff we
really need it. If we are looking for the global (= non-section