https://sourceware.org/bugzilla/show_bug.cgi?id=27533
Bug ID: 27533 Summary: [readelf] -P required to print debug section in dwo file Product: binutils Version: 2.37 (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 this test-case: ... $ gcc ./src/gdb/testsuite/gdb.dwarf2/fission-multi-cu*.c -gsplit-dwarf ... With system readelf (2.35.1), I get the .debug_info section of both .dwo files: ... $ readelf -w a.out 2>&1 | grep "Contents of the .debug_info" Contents of the .debug_info section (loaded from a.out): Contents of the .debug_info.dwo section (loaded from /home/vries/gdb_versions/devel/fission-multi-cu1.dwo): Contents of the .debug_info.dwo section (loaded from /home/vries/gdb_versions/devel/fission-multi-cu2.dwo): ... But with trunk, we only get: ... $ ~/binutils/install/bin/readelf -w a.out 2>&1 | grep "Contents of the .debug_info" Contents of the .debug_info section (loaded from a.out): ... So, there are new options that dictate how links are followed and what is displayed: ... $ ~/binutils/install/bin/readelf -h readelf: Warning: Nothing to do. Usage: readelf <option(s)> elf-file(s) Display information about the contents of ELF format files Options are: -wk,--debug-dump=links Display the contents of sections that link to separate debuginfo files -P,--process-links Display the contents of non-debug sections in separate debuginfo files. (Implies -wK) -wK,--debug-dump=follow-links Follow links to separate debug info files (default) -wN,--debug-dump=no-follow-links Do not follow links to separate debug info files ... >From the description, it seems to me that -wK should be the one that works. But that's the default already. Specifying it explicitly doesn't work either: ... $ ~/binutils/install/bin/readelf -w -wK a.out 2>&1 | grep "Contents of the .debug_info" Contents of the .debug_info section (loaded from a.out): ... So, I don't understand what happens here, and I just try all switches at random, until I find the one that works: ... $ ~/binutils/install/bin/readelf -w -P a.out 2>&1 | grep "Contents of the .debug_info" Contents of the .debug_info section (loaded from a.out): Contents of the .debug_info.dwo section (loaded from /home/vries/gdb_versions/devel/fission-multi-cu1.dwo): Contents of the .debug_info.dwo section (loaded from /home/vries/gdb_versions/devel/fission-multi-cu2.dwo): ... So, I need the switch that switches on printing of non-debug sections to print the debug section .debug_info? AFAIU, either there's something misleading in the description, or there's a bug in the implementation. -- You are receiving this mail because: You are on the CC list for the bug.