Shared libraries: what functions are dynamically linked in?

john.urban urban at cbnewsl.att.com
Fri Apr 26 02:55:37 AEST 1991


In article <47793 at ut-emx.uucp> pefv700 at perv.pe.utexas.edu writes:
>Well, since I'm the original poster, I'll try to clarify.
>
>Say you have a.out, a stripped executable that was linked dynamically with
>a shared library.  (nm won't work here, right?)  Assuming I did it right,
>ldd only told me, "Yes, it's using this shared library."  But I want to
>know the functions in the shared library that will be used when the
>executable is exec'd.

If you don't have the source for a.out and it's stripped it is really hard
to figure this out.

$ ldd a.out
This will tell you if it uses dynamic shared libraries or not.  Unless you wrote
your own version of a particular function it will use the one from the dynamic
shared library (if there is one there).

$ nm /usr/lib/libc.so.1 | grep "|FUNC |" | cut -f8 -d'|' | sort | uniq |
> pr -5 | pg
This will give a sorted list of all the functions available in the dynamic
shared library.

$ what a.out -OR- mcs -p a.out
This will give a dump of the comment section of the a.out.  strip doesn't clear
this.  mcs -d will.  Often this gives you the name of the functions.

Sincerely,

John Urban



More information about the Comp.unix.wizards mailing list