I am using readelf to dump the DWARF2/3 information for an architecture with segmented memories (not an arch supported by gcc, sorry!) and I believe that readelf does not exactly follow the specifications when dumping the .debug_aranges sections in the function display_debug_aranges().
The DWARF2/3 specs, defines the format of an address (segmented or not) by two bytes in the header of a arange block. The first byte is defined as "the size in bytes of an address (or the offset portion of an address for segmented addressing)". The second byte is defined as "the size in bytes of a segment descriptor on the target system." My interpretation is that the total size of an address is obtained by the sum of both bytes. For example, a 32bit address composed of a 8bit segment and a 24bit offset should be described by the pair (3,1). The current implementation is assuming that the size of an address is fully specified by the 1st byte so is likely to crash (or to produce inconsistant results) when the second byte is non-zero. -- Summary: readelf and segmented addresses in DWARF2/3 aranges Product: binutils Version: 2.16 Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: stephane dot chauveau at philips dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=2768 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils