]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Accept the DW_FORM_ref8 type when parsing DWARF types.
authorNick Clifton <nickc@redhat.com>
Tue, 10 Nov 2020 11:55:18 +0000 (11:55 +0000)
committerMark Wielaard <mark@klomp.org>
Mon, 16 Nov 2020 19:41:54 +0000 (20:41 +0100)
* 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)

binutils/ChangeLog
binutils/dwarf.c

index 995cc0c3db954e27f772921337ccc130779d74c3..f7eaee24ec744528836a48cf782da7d90783232c 100644 (file)
@@ -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:
index 2b5fac1c3f81c922551e71e7995adf46d6acd17c..32510fc1773366fe872d65e4b5006c5ad0b36da0 100644 (file)
@@ -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)
        {