+2018-06-12 Mark Wielaard <mark@klomp.org>
+
+ * memory-access.h (read_3ubyte_unaligned_inc): New define.
+
2018-06-12 Mark Wielaard <mark@klomp.org>
* libdw.h (__libdw_dieabbrev): Set die->abbrev to DWARF_END_ABBREV
}
+#define read_3ubyte_unaligned_inc(Dbg, Addr) \
+ ({ uint32_t t_ = read_2ubyte_unaligned (Dbg, Addr); \
+ Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 3); \
+ t_; })
+
#define read_addr_unaligned_inc(Nbytes, Dbg, Addr) \
(assert ((Nbytes) == 4 || (Nbytes) == 8), \
((Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \
+2018-06-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_form_data): Don't increase strreadp after use.
+ Do increase readp for DW_FORM_strx[1234].
+
2018-06-16 Mark Wielaard <mark@klomp.org>
* readelf.c (print_debug_loc_section): Make sure next_off doesn't
{
Dwarf_Off idx;
if (offset_len == 8)
- idx = read_8ubyte_unaligned_inc (dbg, strreadp);
+ idx = read_8ubyte_unaligned (dbg, strreadp);
else
- idx = read_4ubyte_unaligned_inc (dbg, strreadp);
+ idx = read_4ubyte_unaligned (dbg, strreadp);
data = dbg->sectiondata[IDX_debug_str];
if (data == NULL || idx >= data->d_size
case DW_FORM_strx1:
if (readendp - readp < 1)
goto invalid_data;
- val = *readp;
+ val = *readp++;
goto strx_val;
case DW_FORM_strx2:
if (readendp - readp < 2)
goto invalid_data;
- val = read_2ubyte_unaligned (dbg, readp);
+ val = read_2ubyte_unaligned_inc (dbg, readp);
goto strx_val;
case DW_FORM_strx3:
if (readendp - readp < 3)
goto invalid_data;
- val = read_3ubyte_unaligned (dbg, readp);
+ val = read_3ubyte_unaligned_inc (dbg, readp);
goto strx_val;
case DW_FORM_strx4:
if (readendp - readp < 4)
goto invalid_data;
- val = read_4ubyte_unaligned (dbg, readp);
+ val = read_4ubyte_unaligned_inc (dbg, readp);
goto strx_val;
default: