Add support for DW_FORM_ref8 when parsing DWARF types.

This commit is contained in:
Nick Clifton 2020-11-10 12:01:43 +00:00
parent 9138ef7327
commit 7c556a22c9
2 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,34 @@
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 5807744729..cf68ebaff7 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2025,6 +2025,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;
@@ -2115,6 +2130,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)
{

View File

@ -2,7 +2,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.35.1
Release: 13%{?dist}
Release: 14%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -262,6 +262,7 @@ Patch27: binutils-recursive-debuglink-following.patch
# Lifetime: Fixed in 2.36
Patch28: binutils-dwarf-type-sign.patch
Patch29: binutils-dwarf-type-sign-2.patch
Patch30: binutils-dwarf-DW_FORM_ref8.patch
#----------------------------------------------------------------------------
@ -839,8 +840,11 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Tue Nov 10 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-14
- Add support for DW_FORM_ref8 when parsing DWARF types. (#1893921)
* Tue Nov 03 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-13
- Extend fix erroneous decoding of LEB128 values. (#1893921)
- Extend fix for erroneous decoding of LEB128 values.
* Tue Nov 03 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-12
- Another correction for plugin as-needed patch. (#1889763)