libdw: Cache ELF directory early. Explicitly set it in dwfl.
authorMark Wielaard <mark@klomp.org>
Thu, 17 May 2018 17:23:46 +0000 (19:23 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 20 May 2018 21:35:15 +0000 (23:35 +0200)
commit46d5523c94b5e9c830aeba9de863e1b65b08b1df
tree98344940b8f62388620aec92054ea59bd5e4841a
parent3d4998a9edd9f88b46662b3584de89ecd8f2f4c8
libdw: Cache ELF directory early. Explicitly set it in dwfl.

The logic that finds alt files and dwo files relies on having an open
file descriptor. But after all needed ELF data has been read the
underlying Elf file descriptor can be closed. libdwfl in particular
closes file descriptor fairly aggressively. So capture the directory
early on. And make dwfl set it if it has recorded it. Which it will
do now before closing a file descriptor for the main Dwfl_Module file.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_begin_elf.c
libdw/dwarf_end.c
libdw/dwarf_getalt.c
libdw/libdwP.h
libdw/libdw_find_split_unit.c
libdwfl/ChangeLog
libdwfl/dwfl_module.c
libdwfl/dwfl_module_getdwarf.c
libdwfl/libdwflP.h
libdwfl/offline.c