Fix decoding of abbrevs using a DW_FORM_ref_addr attribute.

Resolved: #1056797
This commit is contained in:
Nick Clifton 2014-01-28 12:19:34 +00:00
parent 7c1c0bfb2b
commit 4dda3faefd
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,44 @@
*** ../binutils-2.24.orig/bfd/dwarf2.c 2014-01-28 11:58:02.072737296 +0000
--- bfd/dwarf2.c 2014-01-28 11:59:38.575739971 +0000
*************** find_abstract_instance_name (struct comp
*** 2126,2131 ****
--- 2126,2153 ----
abort ();
info_ptr = unit->sec_info_ptr + die_ref;
+
+ /* Now find the CU containing this pointer. */
+ if (info_ptr >= unit->info_ptr_unit && info_ptr < unit->end_ptr)
+ ;
+ else
+ {
+ /* Check other CUs to see if they contain the abbrev. */
+ struct comp_unit * u;
+
+ for (u = unit->prev_unit; u != NULL; u = u->prev_unit)
+ if (info_ptr >= u->info_ptr_unit && info_ptr < u->end_ptr)
+ break;
+
+ if (u == NULL)
+ for (u = unit->next_unit; u != NULL; u = u->next_unit)
+ if (info_ptr >= u->info_ptr_unit && info_ptr < u->end_ptr)
+ break;
+
+ if (u)
+ unit = u;
+ /* else FIXME: What do we do now ? */
+ }
}
else if (attr_ptr->form == DW_FORM_GNU_ref_alt)
{
*************** find_abstract_instance_name (struct comp
*** 2137,2142 ****
--- 2159,2166 ----
bfd_set_error (bfd_error_bad_value);
return name;
}
+ /* FIXME: Do we need to locate the correct CU, in a similar
+ fashion to the code in the DW_FORM_ref_addr case above ? */
}
else
info_ptr = unit->info_ptr_unit + die_ref;

View File

@ -17,7 +17,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.24
Release: 9%{?dist}
Release: 10%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@ -51,6 +51,8 @@ Patch13: binutils-2.23.2-aarch64-em.patch
Patch14: binutils-2.24-s390-mkopc.patch
# Import fixes for IFUNC and PLT handling for AArch64.
Patch15: binutils-2.24-elfnn-aarch64.patch
# Fix decoding of abstract instance names using DW_FORM_ref_addr.
Patch16: binutils-2.24-DW_FORM_ref_addr.patch
Provides: bundled(libiberty)
@ -168,6 +170,7 @@ using libelf instead of BFD.
%patch13 -p0 -b .aarch64~
%patch14 -p0 -b .mkopc~
%patch15 -p0 -b .elf-aarch64~
%patch16 -p0 -b .ref-addr~
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -473,6 +476,9 @@ exit 0
%endif # %{isnative}
%changelog
* Tue Jan 28 2014 Nick Clifton <nickc@redhat.com> - 2.24-10
- Fix decoding of abbrevs using a DW_FORM_ref_addr attribute. (#1056797)
* Tue Dec 17 2013 Nick Clifton <nickc@redhat.com> - 2.24-9
- Import fixes on 2.24 branch that affect AArch64 IFUNC and PLT handling.