From: Mark Wielaard Date: Mon, 13 Apr 2026 21:30:45 +0000 (+0200) Subject: libdw: Recognize .debug_dwp section in scn_dwarf_type as TYPE_DWO X-Git-Tag: elfutils-0.195~9 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9ba5dfd4744308eb41f00b4dace629bd2d172d39;p=thirdparty%2Felfutils.git libdw: Recognize .debug_dwp section in scn_dwarf_type as TYPE_DWO dwarf_begin_elf tries to guess what type of Dwarf we have. When it sees a .debug_dwp section it assumed it was TYPE_PLAIN instead of TYPE_DWO and would try to find more "plain" .debug sections (ignoring other .dwo sections). This would cause it to not detect any debug sections in a .dwp file containing a .debug_dwp section. * libdw/dwarf_begin_elf.c (scn_dwarf_type): Recognize .debug_dwp or .zdebug_dwp sections. Signed-off-by: Mark Wielaard --- diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c index dd30f79b..7b58ad2e 100644 --- a/libdw/dwarf_begin_elf.c +++ b/libdw/dwarf_begin_elf.c @@ -115,8 +115,10 @@ scn_dwarf_type (Dwarf *result, size_t shstrndx, Elf_Scn *scn) return TYPE_GNU_LTO; else if (strcmp (scnname, ".debug_cu_index") == 0 || strcmp (scnname, ".debug_tu_index") == 0 + || strcmp (scnname, ".debug_dwp") == 0 || strcmp (scnname, ".zdebug_cu_index") == 0 - || strcmp (scnname, ".zdebug_tu_index") == 0) + || strcmp (scnname, ".zdebug_tu_index") == 0 + || strcmp (scnname, ".zdebug_dwp") == 0) return TYPE_DWO; else if (startswith (scnname, ".debug_") || startswith (scnname, ".zdebug_")) {