This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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  <>
> 	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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]