+2021-02-12 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (attr_ok): For DWARF version 4 or higher
+ block forms are not expression locations.
+ (is_constant_offset): DW_FORM_implicit_const is also a constant.
+
2020-12-20 Dmitry V. Levin <ldv@altlinux.org>
* .gitignore: New file.
if (dwarf_whatform (attr) == DW_FORM_exprloc)
return true;
+ if (attr->cu->version >= 4)
+ {
+ /* Must be an exprloc (or constant), just not any block form. */
+ switch (dwarf_whatform (attr))
+ {
+ case DW_FORM_block:
+ case DW_FORM_block1:
+ case DW_FORM_block2:
+ case DW_FORM_block4:
+ __libdw_seterrno (DWARF_E_NO_LOC_VALUE);
+ return false;
+ default:
+ break;
+ }
+ }
+
/* Otherwise must be one of the attributes listed below. Older
DWARF versions might have encoded the exprloc as block, and we
cannot easily distinguish attributes in the loclist class because
case DW_FORM_data8:
case DW_FORM_sdata:
case DW_FORM_udata:
+ case DW_FORM_implicit_const:
break;
}
+2021-02-12 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (attr_callback): Don't handle blocks as expression
+ blocks for DWARF version 4 or higher.
+
2021-02-03 Timm Bäder <tbaeder@redhat.com>
* ar.c (do_oper_extract): Extract should_truncate_fname function
case DW_AT_GNU_call_site_data_value:
case DW_AT_GNU_call_site_target:
case DW_AT_GNU_call_site_target_clobbered:
- if (form != DW_FORM_data16)
+ if (form == DW_FORM_exprloc
+ || (form != DW_FORM_data16
+ && attrp->cu->version < 4)) /* blocks were expressions. */
{
putchar ('\n');
print_ops (cbargs->dwflmod, cbargs->dbg,