views:

520

answers:

6

I have a shared object(dll). How do i find out what all symbols are exported from that?

+1  A: 

see man nm

GNU nm lists the symbols from object files objfile.... If no object files are listed as arguments, nm assumes the file a.out.
VolkerK
btw: for shared objects you need the -D/--dynamic option. e.g. nm -D libmagic.so
VolkerK
+1  A: 

Usually, you would also have a header file that you include in your code to access the symbols.

Ryan Fox
+1  A: 

http://en.wikipedia.org/wiki/Nm_%28Unix%29

Visage
+2  A: 

Do you have a "shared object" (usually a shared library on AIX), a UNIX shared library, or a Windows DLL? These are all different things, and your question conflates them all :-(

For AIX shared object, use "dump -Tv /path/to/foo.o"
For an ELF shared library, use "readelf -s /path/to/libfoo.so", or (if you have GNU nm) "nm -D /path/to/libfoo.so"
For a non-ELF UNIX shared library, please state which UNIX you are interested in.
For a Windows DLL, use "dumpbin /EXPORTS foo.dll".

Employed Russian
+1  A: 

objdump is another good one on linux.

smcameron
+1  A: 

On *nix check nm. On windows use the program Dependency Walker

AllDayCpp