summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2017-12-28 17:44:06 +0100
committerMark Wielaard <mark@klomp.org>2018-02-21 17:20:30 +0100
commit8e5e78927ee319816eb7a74f870671d21e762bfc (patch)
treec17038a711cda068bf7dc73a6824b36b044f6eca /src
parent8961f33e2a72a9430455cbb0368c71d22574dc3d (diff)
downloadelfutils-8e5e78927ee319816eb7a74f870671d21e762bfc.tar.gz
libdw: Add support for DWARF5 DW_FORM_data16.
The DWARF5 spec says DW_FORM_data16 is constant class (128bit value). But we treat it as if it is block class. So to use a attribute that is encoded as DW_FORM_data16 use dwarf_formblock, not dwarf_form[us]data. We cannot use dwarf_form[us]data since they return a Dwarf_Word/Sword, which are only 64bits. This does mean we don't try to convert the value but just return it as a block of 16 raw bytes. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/readelf.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 28273663..0ae01e92 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2018-02-09 Mark Wielaard <mark@klomp.org>
+ * readelf.c (attr_callback): Handle DW_FORM_data16 as Dwarf_Block.
+
+2018-02-09 Mark Wielaard <mark@klomp.org>
+
* readelf.c (print_debug_abbrev_section): Print the value of a
DW_FORM_implicit_const using dwarf_getabbrevattr_data.
(attr_callback): Handle DW_FORM_implicit_const.
diff --git a/src/readelf.c b/src/readelf.c
index bdeba4b6..2d49af34 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6083,7 +6083,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_FORM_implicit_const:
case DW_FORM_udata:
case DW_FORM_sdata:
- case DW_FORM_data8:
+ case DW_FORM_data8: /* Note no data16 here, we see that as block. */
case DW_FORM_data4:
case DW_FORM_data2:
case DW_FORM_data1:;
@@ -6276,6 +6276,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_FORM_block2:
case DW_FORM_block1:
case DW_FORM_block:
+ case DW_FORM_data16: /* DWARF5 calls this a constant class. */
if (cbargs->silent)
break;
Dwarf_Block block;