While inspecting some type units I noticed the type offset seemed off.
We were printing the offset as is, but it should include the offset of
the unit. There was actually a testcase for this, run-readelf-types.sh
but that had the same bug in the expected output. Fixed both.
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2021-02-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_units): Type DIE offset is from start CU.
+
2021-02-12 Mark Wielaard <mark@klomp.org>
* readelf.c (attr_callback): Don't handle blocks as expression
{
Dwarf_Die typedie;
Dwarf_Off dieoffset;
- dieoffset = dwarf_dieoffset (dwarf_offdie_types (dbg, subdie_off,
+ dieoffset = dwarf_dieoffset (dwarf_offdie_types (dbg, cu->start
+ + subdie_off,
&typedie));
printf (_(" Type unit at offset %" PRIu64 ":\n"
" Version: %" PRIu16
+2021-02-12 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-types.sh: Add CU start to type offset reference.
+
2021-02-07 Alexander Miller <alex.miller@gmx.de>
* Makefile.am (TESTS_ENVIRONMENT): Quote variables.
specification (ref4) [ 34]
Type unit at offset 67:
Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
- Type signature: 0x18763953736e2de0, Type offset: 0x25 [25]
+ Type signature: 0x18763953736e2de0, Type offset: 0x25 [68]
[ 5a] type_unit abbrev: 1
language (data1) C_plus_plus (4)
GNU_odr_signature (data8) 16005269134005989797