We would print a "fake" .debug_addr header, but didn't always setup the
unit_length (in case there was a mix of GNU DebugFission and DWARF5 tables).
Make sure to always set the unit_length (we do always calculate the next
unit offset already).
Signed-off-by: Mark Wielaard <mark@klomp.org>
2018-06-05 Mark Wielaard <mark@klomp.org>
+ * readelf.c (print_debug_addr_section): Set unit_length always to
+ (next_unitp - readp) in case we don't have a real header.
+
+2018-06-05 Mark Wielaard <mark@klomp.org>
+
* readelf.c (print_debug_loc_section): Set begin to idx when failing
to read the start address if DW_LLE_GNU_start_end_entry.
/* The addresses start here, but where do they end? */
listptr = get_listptr (&known_addrbases, idx);
if (listptr == NULL)
- {
- next_unitp = readendp;
- unit_length = (uint64_t) (next_unitp - readp);
- }
+ next_unitp = readendp;
else if (listptr->cu->version < 5)
{
next_unitp = start + listptr->offset;
PRIx64, off);
next_unitp = readendp;
}
- unit_length = (uint64_t) (next_unitp - readp);
}
else
{
next_unitp = readendp;
}
}
+ unit_length = (uint64_t) (next_unitp - readp);
/* Pretend we have a header. */
printf ("\n");