]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdw: fix offset for sig8 lookup in dwarf_formref_die
authorJason P. Leasure <jpleasu@super.org>
Wed, 14 Jan 2015 14:26:55 +0000 (09:26 -0500)
committerMark Wielaard <mjw@redhat.com>
Wed, 14 Jan 2015 20:34:47 +0000 (21:34 +0100)
The type_offset of a type unit header is relative to the beginning
of the type unit header.

Signed-off-by: Jason P. Leasure <jpleasu@super.org>
libdw/ChangeLog
libdw/dwarf_formref_die.c

index fe39dcdc2adfbe01971777221fa0732bf805e062..dc3b59f4877c1aba3f494867b7b0eba109ed4a96 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-14  Jason P. Leasure <jpleasu@super.org>
+
+       * dwarf_formref_die.c (dwarf_formref_die): Offset is cu->type_offset
+       plus cu->start.
+
 2014-12-27  Mark Wielaard  <mjw@redhat.com>
 
        * dwarf_siblingof.c (dwarf_siblingof): Check sibling attribute offset
index 63f669716e88f8d0d8a71a68e504d9046654eca2..8b92e22d11fafe09be84a5799d28884ca717d7c7 100644 (file)
@@ -95,7 +95,7 @@ dwarf_formref_die (attr, result)
 
       datap = cu->dbg->sectiondata[IDX_debug_types]->d_buf;
       size = cu->dbg->sectiondata[IDX_debug_types]->d_size;
-      offset = cu->type_offset;
+      offset = cu->start + cu->type_offset;
     }
   else
     {