I want to view the exported functions of a shared library on Linux.
What command allows me to do this?
(On Windows I use the program depends)
What you need is nm and its -D option:
$ nm -D /usr/lib/libopenal.so.1
.
.
.
00012ea0 T alcSetThreadContext
000140f0 T alcSuspendContext
U atanf
U calloc
.
.
.
Exported sumbols are indicated by a T. Required symbols that must be loaded from other shared objects have a U. Note that the symbol table does not include just functions, but exported variables as well.
See the nm manual page for more information.
user2391685
objdump -T *.so may also do the job
Vincent Fenet
On a MAC, you need to use nm *.o | c++filt, as there is no -C option in nm.
来源:https://stackoverflow.com/questions/4514745/how-do-i-view-the-list-of-functions-a-linux-shared-library-is-exporting