ELF Binary information extraction
Library symbol listing
nm -C /PATH/TO/STATIC/LIBRARY/lib.a
comm-c0761e06ea036fdd.comm14-e1f6fa1b765f1060a1adaa86eb00af21.rs.rcgu.o:
0000000000000000 T c_die
0000000000000000 T c_drop_message
0000000000000000 T c_get_target
0000000000000000 T c_init
0000000000000000 T c_poll
0000000000000000 T c_recv
0000000000000000 T c_recv_fd
0000000000000000 T c_send
0000000000000000 T c_send_fd
0000000000000000 T c_set_role
Symbol types are one of the two types most of the time, but more exist, of course.
"T" / "t": The symbol is in the text (code) section.
"U" / "u:" The symbol is undefined.
Source: https://linux.die.net/man/1/nm
nm -C /PATH/TO/OBJECT/FILE/lib.cpp.o
U sleep
U __stack_chk_fail
0000000000000000 T threadOne
0000000000000000 T threadTwo
U c_set_role(long)
U c_get_target()
U c_drop_message(Message*)
U c_init(long)
U c_recv()
U c_send(long, char const*, char const*)
Library Infornation dump (General):
Static library file contents
ar -t lib.a
Library Symbol listing
nm lib.a
Symbol listing w/ C++ name mangling
nm -C lib.a
ELF architecture dump and more
objdump -f lib.a
Shared library dependencies
ldd -r -v libnanomsg.so
readelf -d libnanomsg.so | grep NEEDED
$ readelf -d lib.so | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libnanomsg.so.5]
0x0000000000000001 (NEEDED) Shared library: [libdl.so]
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so]
$ readelf -d libnanomsg.so | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libdl.so]
0x0000000000000001 (NEEDED) Shared library: [libc.so]
Dynamic listing of process/executable dependencies / loaded shared libraries
sudo awk '/\.so/{print $6}' /proc/<PID>/maps | sort -u
strace -e trace=open <BINARY-EXECUTABLE>
lsof -p <PID> | grep mem
0x0000000000000001 (NEEDED) Shared library: [libdl.so]
0x0000000000000001 (NEEDED) Shared library: [libc.so]
0x000000000000000e (SONAME) Library soname: [libnanomsg.so.5]