summaryrefslogtreecommitdiff
path: root/libdw
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2013-10-03 12:38:25 -0700
committerJosh Stone <jistone@redhat.com>2013-10-03 12:38:25 -0700
commit5dbbc5e32cc1fb3a7cf33e52e0bfc6f47097f3fe (patch)
tree7d2904feb5d3c00f8c6dde4bd284c9e95dbab241 /libdw
parentacf126799e73e10f571da6c9be487b84a0a46f23 (diff)
downloadelfutils-5dbbc5e32cc1fb3a7cf33e52e0bfc6f47097f3fe.tar.gz
libdw: Make sure that every debug_types sig8 is hashed
When dwarf_formref_die can't find a sig8 in the hash, it walks __libdw_intern_next_unit, and was then adding those to the hash. However, if dwarf_offdie_types is called earlier, which also uses that next_unit, then they are missed from the hash (and never revisited). This patch makes __libdw_intern_next_unit do the sig8 hash insert, so no type unit is ever missed. Signed-off-by: Josh Stone <jistone@redhat.com>
Diffstat (limited to 'libdw')
-rw-r--r--libdw/ChangeLog6
-rw-r--r--libdw/dwarf_formref_die.c1
-rw-r--r--libdw/libdw_findcu.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 951f1cba..e8580965 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-03 Josh Stone <jistone@redhat.com>
+
+ * dwarf_formref_die.c (dwarf_formref_die): Don't hash the sig8 here.
+ * libdw_findcu.c (__libdw_intern_next_unit): Since this never revisits
+ a unit, make sure to always hash the sig8 here, so none are missed.
+
2013-09-29 Mark Wielaard <mjw@redhat.com>
* dwarf_getlocation.c (store_implicit_value): Cast op->number2 to
diff --git a/libdw/dwarf_formref_die.c b/libdw/dwarf_formref_die.c
index b1af2abf..b54e2166 100644
--- a/libdw/dwarf_formref_die.c
+++ b/libdw/dwarf_formref_die.c
@@ -89,7 +89,6 @@ dwarf_formref_die (attr, result)
?: DWARF_E_INVALID_REFERENCE);
return NULL;
}
- Dwarf_Sig8_Hash_insert (&cu->dbg->sig8_hash, cu->type_sig8, cu);
}
while (cu->type_sig8 != sig);
diff --git a/libdw/libdw_findcu.c b/libdw/libdw_findcu.c
index 70e24a03..c0bff2af 100644
--- a/libdw/libdw_findcu.c
+++ b/libdw/libdw_findcu.c
@@ -110,6 +110,9 @@ __libdw_intern_next_unit (dbg, debug_types)
newp->lines = NULL;
newp->locs = NULL;
+ if (debug_types)
+ Dwarf_Sig8_Hash_insert (&dbg->sig8_hash, type_sig8, newp);
+
/* Add the new entry to the search tree. */
if (tsearch (newp, tree, findcu_cb) == NULL)
{