Ever so often I want to do two things:
- read the table of symbols exported from a shared library/executable
- read the soname of a library along with shared library dependencies
Here's how to do both with 3 tools: nm
, readelf
, objdump
. For the sake of
brevity I will be working on a DSO1 called libtest.so
.
Reading symbol table
nm -CD libtest.so
readelf -sD libtest.so # no demangling!
objdump -CT libtest.so
Dynamic section
readelf -d libtest.so
objdump -p libtest.so
ldd
also works on shared libraries.
-
Dynamic Shared Object ↩