This is the mail archive of the mailing list for the binutils 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: get link map during execution

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

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