On 10/19/2010 11:25 PM, arnaud.champion(a)devatom.fr wrote:
?I have tried libc.so and it doesn't contains _strdup, amybe
it's strdup
instead I will try. Anyway I have a little question (a windowsian
question :) ). Under windows I have a tool named "depends.exe" with it,
I can sse what is exposed thru a dll, is there any equivalent under linux ?
Hmmm, two tools might be useful, but I don't personally know them in
much depth:
+ ldd
+ nm
ldd can be used on an executable file, to show which dynamic libraries
that file needs. For example, if I have the program "/bin/bash":
$ ldd /bin/bash
linux-vdso.so.1 => (0x00007fff999ff000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00000030cd600000)
libdl.so.2 => /lib64/libdl.so.2 (0x00000030bc200000)
libc.so.6 => /lib64/libc.so.6 (0x00000030bba00000)
/lib64/ld-linux-x86-64.so.2 (0x00000030bb600000)
The "nm" program, can be used on a dynamic library to show which
symbols it provides. For example, on /lib64/libc.so.6:
$ nm /lib64/libc.so.6
<snip>
00000030bbd7ba60 B __daylight
00000030bba2c550 T __dcgettext
00000030bba2c550 t __dcgettext_internal
00000030bba2d5e0 t __dcigettext
00000030bba2dfc0 t __dcngettext
00000030bba7c600 T __default_morecore
00000030bba33140 t __default_sigpause
00000030bba2c560 T __dgettext
00000030bba95be0 t __difftime
00000030bbb1e7c0 t __dl_iterate_phdr
00000030bba2dfd0 t __dngettext
00000030bba4f150 t __dprintf
<snip - it is a long list>
Both nm and ldd can be given options, which change what they display.
Looking at the questions you are asking, they are a bit unusual.
There is nothing _wrong_ with your questions, but they make me curious
what you are trying to do. If you are ok to explain the idea you are
trying, we might know of a better or easier way. (no guarantees
though!) :)
Regards and best wishes,
Justin Clift
Arnaud