print_cfa_program might call print_ops with zero offset size. We don't
need (and don't know) the DWARF offset size in that case. DW_OP_call_ref
and DW_OP_GNU_implicit_pointer need to know the offset size because they
reference a DIE. But they are invalid when used from CFA.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2014-12-07 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
+ and DW_OP_GNU_implicit_pointer.
+
2014-12-04 Mark Wielaard <mjw@redhat.com>
* objdump.c (show_relocs_x): Make sure destshdr exists.
case DW_OP_call_ref:
/* Offset operand. */
+ if (ref_size == 0)
+ goto invalid; /* Cannot be used in CFA. */
NEED (ref_size);
if (ref_size == 4)
addr = read_4ubyte_unaligned (dbg, data);
/* DIE offset operand. */
start = data;
NEED (ref_size + 1);
+ if (ref_size == 0)
+ goto invalid; /* Cannot be used in CFA. */
if (ref_size == 4)
addr = read_4ubyte_unaligned (dbg, data);
else