https://sourceware.org/bugzilla/show_bug.cgi?id=31734
Bug ID: 31734 Summary: [binutils, readelf] dwarf4 .debug_str_offsets section printed incorrectly Product: binutils Version: 2.43 (HEAD) Status: NEW Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider a hello world, compiled with split dwarf: ... $ gcc-13 -gdwarf-4 -gsplit-dwarf -ggnu-pubnames -fdebug-types-section -Wl,--gdb-index -fuse-ld=gold ~/data/hello.c -g3 -save-temps -dA ... When dumping dwarf with readelf we get: ... $ readelf -w a.out > READELF readelf: Warning: string index of 707 converts to an offset of 0xb14 which is too big for section .debug_str.dwo readelf: Warning: string index of 708 converts to an offset of 0xb18 which is too big for section .debug_str.dwo ... If we look into the a-hello.s, the first three entries are: ... .section .debug_str_offsets.dwo,"e",@progbits .long 0 # indexed string 0x0: __FLT16_NORM_MAX__ 6.55040000000000000000000000000000000e+4F16 .long 0x3f # indexed string 0x1: _SIZE_T_ .long 0x49 # indexed string 0x2: __SIG_ATOMIC_MAX__ 0x7fffffff ... but readelf starts here, at the third entry: ... Contents of the .debug_str_offsets.dwo section (loaded from /home/vries/gdb/a-hello.dwo): Length: 0xb14 Index Offset [String] 0 00000000 __SIG_ATOMIC_MAX__ 0x7fffffff ... llvm-dwarfdump starts at the first entry, and doesn't warn or error out. -- You are receiving this mail because: You are on the CC list for the bug.