This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [patch 2/2] Fix core files for re-prelink-ed files
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 05 Nov 2013 18:18:23 +0100
- Subject: Re: [patch 2/2] Fix core files for re-prelink-ed files
On Fri, 2013-11-01 at 16:07 +0100, Jan Kratochvil wrote:
> That is if you generate core file, re-prelink you system (which happens
> nightly) and try to load the core file some shared libraries may no longer
> load at their right place.
>
> It happens even during "make check" for jankratochvil/unwindx86 which I am not
> sure why now. But the code was clearly wrong wrt prelink anyway.
>
> Fortunately link_map->l_ld is absolute address so one can recompute new l_addr
> according to it, ignoring former link_map->l_addr.
Right, l_ld points to the dynamic section, so looking that up in the elf
file one can recompute the difference between file and memory again.
> There is no test case, though.
> libdwfl/
> 2013-11-01 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Fix core files for re-prelink-ed files.
> * core-file.c (dynamic_vaddr_get): New function.
> (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
> dynamic_vaddr_get instead of using L_ADDR.
> * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
> * link_map.c (report_r_debug): Do not initialize l_addr.
Looks good to me.
Thanks,
Mark