This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: get link map during execution
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Yannick PERRET <yperret at bat710 dot univ-lyon1 dot fr>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 4 Feb 2002 10:44:27 -0500
- Subject: Re: get link map during execution
- References: <3C5E971C.1FC2D88C@bat710.univ-lyon1.fr>
On Mon, Feb 04, 2002 at 03:13:48PM +0100, Yannick PERRET wrote:
> Hi.
>
> I'm writing a profiler for gcc-compiled C and C++ programs
> (http://sourceforge.net/projects/fnccheck/)
>
> The profiling part is fine, but I have a problem when trying
> to convert symbol addresses into functions names.
>
> I use BFD to open the program and convert addresses into names.
> In order to allow profiling of dynamic libraries, I also open used
> .so to solve unresolved addresses.
>
> My only problem is about .so opened with 'dlopen' from 'dlfcn.h'.
> These symbols are profiled but the references are not present in
> the program (of course).
>
> I'm now using 'link.h' to parse the existing libraries, and it appear
> that objects opened with 'dlopen' are visible, but only between the
> 'dlopen' and the corresponding 'dlclose'.
> Is there a way to get the complete list of used libraries at the end of
> the execution (even those which are closed) ?
No, there isn't. The link map only reflects currently loaded
libraries. You may want to provide a replacement dlopen, or something
along those lines.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer