aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-11-10 11:55:18 +0000
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-01-23 20:21:51 +0200
commitc4474590b4f2271443af35ec02d21a6f03a8a727 (patch)
tree3fd071f750927bff3f1e8e54b73f5e006ef3b854
parentFix the decoding of DW_FORM_ref_addr DWARF attribute. (diff)
downloadbinutils-gdb-c4474590b4f2271443af35ec02d21a6f03a8a727.tar.gz
binutils-gdb-c4474590b4f2271443af35ec02d21a6f03a8a727.tar.bz2
binutils-gdb-c4474590b4f2271443af35ec02d21a6f03a8a727.zip
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) (cherry picked from commit 6feeb5de6a245f5739bc0369beb774a3ba1191f2)
-rw-r--r--binutils/ChangeLog8
-rw-r--r--binutils/dwarf.c16
2 files changed, 24 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 995cc0c3db..f7eaee24ec 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,6 +1,14 @@
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:
2020-10-27 Nick Clifton <nickc@redhat.com>
* dwarf.c (struct abbrev_list): New structure. Used to collect
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 2b5fac1c3f..32510fc177 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)
{