summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_end.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-01-18 15:03:43 +0100
committerMark Wielaard <[email protected]>2018-05-19 16:06:21 +0200
commit383eef45f6951482bdb929782422fd8550c9e6e6 (patch)
tree537ffd5d3ed34e2b32ca5c26ac4c1c1a2b7f40d4 /libdw/dwarf_end.c
parent77cbbbd40432ca79f052c3d5bb620afbced0c1a1 (diff)
libdw: dwarf_get_units find split units from .dwo.
For a skeleton DIE dwarf_get_units should provide the split DIE as subdie. This implements that by trying to find the (named) .dwo file and finding the matching CU in it. The .dwo file is search relative to the current DWARF or using the comp_dir of the skeleton DIE. Also fixes a small issue with str_offsets_base_off which is tested in the new testcase (by getting the name of the split CU DIE). Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_end.c')
-rw-r--r--libdw/dwarf_end.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdw/dwarf_end.c b/libdw/dwarf_end.c
index f6915abf..43223de0 100644
--- a/libdw/dwarf_end.c
+++ b/libdw/dwarf_end.c
@@ -55,6 +55,11 @@ cu_free (void *arg)
Dwarf_Abbrev_Hash_free (&p->abbrev_hash);
tdestroy (p->locs, noop_free);
+
+ /* Free split dwarf one way (from skeleton to split). */
+ if (p->unit_type == DW_UT_skeleton
+ && p->split != NULL && p->split != (void *)-1)
+ INTUSE(dwarf_end) (p->split->dbg);
}