How can I look inside a Linux.so or .a object and see what features they contain?

Perhaps the linker can do this, so is there a command-line tool for displaying functions in object files and specifying function names and their signatures?

+4
source share
2 answers

you can do nm Linux.soand it will show the functions and variables inside the .so file.

+5
source

For a shared library, you should use:

nm -D /path/to/libwhatever.so.<num>

-D, nm ; -D , . Ubuntu 12:

$ nm /lib/i386-linux-gnu/libc.so.6 
nm: /lib/i386-linux-gnu/libc.so.6: no symbols
$ nm -D /lib/i386-linux-gnu/libc.so.6 | tail
0011fc20 T xdr_wrapstring
001202c0 T xdrmem_create
00115540 T xdrrec_create
001157f0 T xdrrec_endofrecord
00115740 T xdrrec_eof
00115690 T xdrrec_skiprecord
00120980 T xdrstdio_create
00120c70 T xencrypt
0011d330 T xprt_register
0011d450 T xprt_unregister

libc.so , nm ; , , , nm -D.

.a .o nm. - ; , .

+5

Source: https://habr.com/ru/post/1650864/


All Articles