summaryrefslogtreecommitdiffstats
path: root/libdwfl/dwfl_module.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-05-01 14:48:27 +0200
committerMark Wielaard <[email protected]>2014-05-02 17:00:48 +0200
commitdf85bf99021119fcbb2ced66dd69f1cceafb180c (patch)
treea0ee033052e69b9b00e87ee31bf4962dac3cec17 /libdwfl/dwfl_module.c
parentd81d32d2a4f92355e4c677b578147dfe819251b9 (diff)
libdwfl: Move dwz alt multi file searching to find_debuginfo callback.
Don't hard code the Dwarf dwz alt multi file search but allow the user to override it through the standard Dwfl_Callbacks. Also move ownership completely to the user of dwarf_setalt by removing free_alt from Dwarf and adding alt, fd and elf fields to Dwfl_Module. Add a relative .dwz file test case. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl/dwfl_module.c')
-rw-r--r--libdwfl/dwfl_module.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index bb167ab2..8efcfaa5 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -1,5 +1,5 @@
/* Maintenance of module list in libdwfl.
- Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007, 2008, 2014 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -71,7 +71,17 @@ __libdwfl_module_free (Dwfl_Module *mod)
}
if (mod->dw != NULL)
- INTUSE(dwarf_end) (mod->dw);
+ {
+ INTUSE(dwarf_end) (mod->dw);
+ if (mod->alt != NULL)
+ {
+ INTUSE(dwarf_end) (mod->alt);
+ if (mod->alt_elf != NULL)
+ elf_end (mod->alt_elf);
+ if (mod->alt_fd != -1)
+ close (mod->alt_fd);
+ }
+ }
if (mod->ebl != NULL)
ebl_closebackend (mod->ebl);