While investigating the execs of gdb.dwarf2/dwzbuildid.exp using readelf I ran
into a warning:
...
$ readelf -w dwzbuildid-ok > READELF
readelf: Warning: .debug_info offset of 0x2e in .debug_aranges section does not
point to a CU header.
...
AFAICT, the warning is incorrect, I've filed PR binutils/30835 about that.
While looking at the .debug_aranges section, I noticed that the entries for
the CUs generated by the dwarf assembler are missing.
Fix this by adding the missing .debug_aranges entries.
Tested on x86_64-linux.
# Only the DWARF reader checks .gnu_debugaltlink, so make sure
# there is a bit of DWARF in here.
- cu {} {
+ cu { label cu_start } {
compile_unit {{language @DW_LANG_C}} {
}
}
+ aranges {} cu_start {
+ arange {} 0 0
+ }
}
}
build_id $buildid
- cu {} {
+ cu { label cu_start } {
compile_unit {{language @DW_LANG_C}} {
int_label2: base_type {
{name int}
}
}
}
+
+ aranges {} cu_start {
+ arange {} 0 0
+ }
}
}