From: Tom de Vries Date: Wed, 21 Jan 2026 15:43:07 +0000 (+0100) Subject: [gdb] Ignore .sframe section in dtrace_static_probe_ops::get_probes X-Git-Tag: binutils-2_46~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=162e5c93df8ee975d6dfce122daa244bd628d920;p=thirdparty%2Fbinutils-gdb.git [gdb] Ignore .sframe section in dtrace_static_probe_ops::get_probes On aarch64-linux (Debian testing), with test-case gdb.base/fission-macro.exp I run into: ... (gdb) set complaints 5^M (gdb) file fission-macro-v4-b32-s0^M Reading symbols from fission-macro-v4-b32-s0...^M During symbol reading: \ skipping section '.sframe' which does not contain valid DOF data.^M (gdb) FAIL: $exp: lang=c: dwarf_version=4: dwarf_bits=32: strict_dwarf=0: \ No complaints ... The problem is that there's an overlap between: ... ./include/elf/common.h:#define SHT_SUNW_dof 0x6ffffff4 ... and: ... ./include/elf/common.h:#define SHT_GNU_SFRAME 0x6ffffff4 ... So when dtrace_static_probe_ops::get_probes tries reading an SHT_SUNW_dof section, it fails to read the corresponding magic number and bails with this complaint: ... During symbol reading: \ skipping section '.sframe' which does not contain valid DOF data.^M ... But the section actually being read is not an SHT_SUNW_dof section, but an SHT_GNU_SFRAME section: ... [Nr] Name Type Address Off Size ES Flg Lk Inf Al [17] .sframe GNU_SFRAME 00000000000008f0 0008f0 000035 00 A 0 0 8 ... Fix this by checking for the section name .sframe in dtrace_static_probe_ops::get_probes. Tested on aarch64-linux. Approved-By: Simon Marchi Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33813 --- diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index ee9d0d4e568..b42afea5a17 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -841,7 +841,12 @@ dtrace_static_probe_ops::get_probes information. */ for (sect = abfd->sections; sect != NULL; sect = sect->next) { - if (elf_section_data (sect)->this_hdr.sh_type == SHT_SUNW_dof) + /* Both SHT_SUNW_dof and SHT_GNU_SFRAME are defined as 0x6ffffff4. + So for .sframe sections with sh_type == SHT_GNU_SFRAME, it also holds + that sh_type == SHT_SUNW_dof. Therefore, in addition to the sh_type + check, we need to check for sections named .sframe. */ + if (elf_section_data (sect)->this_hdr.sh_type == SHT_SUNW_dof + && strcmp (bfd_section_name (sect), ".sframe") != 0) { bfd_byte *dof;