This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How I know which modules from a givem library one program has?
- From: Joe Buck <jbuck at synopsys dot com>
- To: lgoncalves at av dot it dot pt (Luis Gonçalves)
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 29 Oct 2002 18:20:45 -0800 (PST)
- Subject: Re: How I know which modules from a givem library one program has?
> Dear all
>
> I am using Linux as plataform of work and the compiller "gcc".
> My programs call mathematical routines that are in Mathematical Library. I
> have the sources of that library. That library is organized in layers. I
> want a way (with gnu tools) of knowing the routines or modules that are
> inserted at compilation time from that library.
The GNU linker has an option --print-map, which might help you.
To get GCC to tell the linker to print the map, you would say
gcc -Xlinker --print-map [files,options,etc]
>From the GNU linker manual:
--print-map
Print a link map to the standard output. A link map provides
information about the link, including the following:
* Where object files and symbols are mapped into memory.
* How common symbols are allocated.
* All archive members included in the link, with a mention of the symbol
which caused the archive member to be brought in.
This only works on GNU/Linux or if the compiler has been configured to
use the GNU linker.