Finding out what C++ symbols are in a library.

I was debugging a problem today that required me to find out what symbols were in a .so dynamic library. Being C++ symbols, the output from objdump wasn’t really very helpful. So in the interest of spreading my knowledge, I will now share the technique that worked for me with you guys:

Use this to dump the symbol table of a library: objdump -t <i>/path/to/lib</i> | perl -e 'while() { ($text) = m/(\w+)$/; print "$text\n"; }' | c++filt

Use this to dump the dynamic symbol table of a library: objdump -T <i>/path/to/lib</i> | perl -e 'while() { ($text) = m/(\w+)$/; print "$text\n"; }' | c++filt