This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to determine which symbols in a library are used by the client?
- From: Nick Clifton <nickc at redhat dot com>
- To: Rick Mann <rmann at latencyzero dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Mon, 17 Sep 2007 17:42:15 +0100
- Subject: Re: How to determine which symbols in a library are used by the client?
- References: <ECAAB73E-0E36-4C72-8A3F-10FD951AABFF@latencyzero.com>
Hi Rick,
I have a 3rd party graphics library and some code that uses it. I think
we want to replace the graphics library, but we need to see what
routines are called in it. Is there an easy way to do this?
Sure - just link your compiled code but without including the 3rd party
graphics library. You should get "unresolved reference" errors from the linker
for the functions in the graphics library that are called from your code.
Alternatively link your application as normal, including the graphics library,
but also including the "-Map foo.map" command line option. Then look through
the foo.map file for the names of the symbols from the graphics library that
have been included in the executable.
Cheers
Nick