From: Nick Clifton Date: Tue, 10 Nov 2020 11:55:18 +0000 (+0000) Subject: Accept the DW_FORM_ref8 type when parsing DWARF types. X-Git-Tag: binutils-2_35_2~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6feeb5de6a245f5739bc0369beb774a3ba1191f2;p=thirdparty%2Fbinutils-gdb.git 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 --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 + + Backport from the mainline: + 2020-11-10 Nick Clifton + + * dwarf.c (skip_attr_bytes): Correctly handle DW_FORM_ref8. + (get_type_abbrev_from_form): Accept DW_FORM_ref8. + 2020-11-15 Mark Wielaard 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) {