Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!snorkelwacker.mit.edu!paperboy!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnews!cbnewsl!urban From: urban@cbnewsl.att.com (john.urban) Newsgroups: comp.unix.wizards Subject: Re: Shared libraries: what functions are dynamically linked in? Message-ID: <1991Apr25.165537.8331@cbnewsl.att.com> Date: 25 Apr 91 16:55:37 GMT References: <47793@ut-emx.uucp> Distribution: usa Organization: AT&T Bell Laboratories Lines: 29 In article <47793@ut-emx.uucp> pefv700@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