From: Mark Wielaard Date: Sun, 27 May 2018 12:05:21 +0000 (+0200) Subject: libdwfl: Allow partial relocations also for debug files. X-Git-Tag: elfutils-0.171~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=263dbe8ca17f66baa184f489530eb92afa15adfe;p=thirdparty%2Felfutils.git libdwfl: Allow partial relocations also for debug files. __libdwfl_relocate is called for get_dwarf and get_elf. We allow not all relocations to be resolved for Elf files, but required all relocations (in the debug sections) to be fully resoled in Dwarf files. This used to mostly work out with .o ET_REL files when the main Elf was gotten before the Dwarf. But with .dwo files, we (readelf) might open the .o file just for the (skeleton) Dwarf. In this case it could happen not all relocations in the debug sections could be resolved (.debug_info and .debug_addr might contain referenes to undefined symbols). So allow partial relocations also for debug files. Signed-off-by: Mark Wielaard --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index d69fe0cd1..34aa07d1f 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2018-05-27 Mark Wielaard + + * relocate.c (__libdwfl_relocate): Always call relocate_section with + partial true. + 2018-05-17 Mark Wielaard * dwfl_module (__libdwfl_module_free): Free elfdir. diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c index 176824335..9afcdebec 100644 --- a/libdwfl/relocate.c +++ b/libdwfl/relocate.c @@ -751,7 +751,7 @@ __libdwfl_relocate (Dwfl_Module *mod, Elf *debugfile, bool debug) else result = relocate_section (mod, debugfile, ehdr, d_shstrndx, &reloc_symtab, scn, shdr, tscn, - debug, !debug); + debug, true /* partial always OK. */); } }