[binutils-gdb/binutils-2_35-branch] Accept the DW_FORM_ref8 type when parsing DWARF types.
Mark Wielaard
mark@sourceware.org
Mon Nov 16 19:54:08 GMT 2020
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6feeb5de6a245f5739bc0369beb774a3ba1191f2
commit 6feeb5de6a245f5739bc0369beb774a3ba1191f2
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Nov 10 11:55:18 2020 +0000
Accept the DW_FORM_ref8 type when parsing DWARF types.
* dwarf.c (skip_attr_bytes): Correctly handle DW_FORM_ref8.
(get_type_abbrev_from_form): Accept DW_FORM_ref8.
(cherry picked from commit 1f57314183549008c065ad2240598d2b0f0ff56b
and commit ed1afd86668781159a131dc9c9c4a54a3b0a1e3a)
Diff:
---
binutils/ChangeLog | 8 ++++++++
binutils/dwarf.c | 16 ++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 995cc0c3db9..f7eaee24ec7 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,11 @@
+2020-11-15 Mark Wielaard <mark@klomp.org>
+
+ Backport from the mainline:
+ 2020-11-10 Nick Clifton <nickc@redhat.com>
+
+ * dwarf.c (skip_attr_bytes): Correctly handle DW_FORM_ref8.
+ (get_type_abbrev_from_form): Accept DW_FORM_ref8.
+
2020-11-15 Mark Wielaard <mark@klomp.org>
Backport from the mainline:
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 2b5fac1c3f8..32510fc1773 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2021,6 +2021,21 @@ skip_attr_bytes (unsigned long form,
break;
case DW_FORM_ref8:
+ {
+ dwarf_vma high_bits;
+
+ SAFE_BYTE_GET64 (data, &high_bits, &uvalue, end);
+ data += 8;
+ if (sizeof (uvalue) > 4)
+ uvalue += high_bits << 32;
+ else if (high_bits != 0)
+ {
+ /* FIXME: What to do ? */
+ return NULL;
+ }
+ break;
+ }
+
case DW_FORM_data8:
case DW_FORM_ref_sig8:
data += 8;
@@ -2111,6 +2126,7 @@ get_type_abbrev_from_form (unsigned long form,
case DW_FORM_ref1:
case DW_FORM_ref2:
case DW_FORM_ref4:
+ case DW_FORM_ref8:
case DW_FORM_ref_udata:
if (uvalue + cu_offset > section->size)
{
More information about the Binutils-cvs
mailing list