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

November 23rd 2004 08:44 am

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 /path/to/lib | perl -e 'while() { ($text) = m/(\w+)$/; print "$text\n"; }' | c++filt

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

Posted by mpyne under Uncategorized | 2 Comments »

2 Responses to “Finding out what C++ symbols are in a library.”

  1. ladiode Identicon Icon ladiode responded on 23 Oct 2009 at 10:14 #

    Thx for this, it was really helpful

  2. mama Identicon Icon mama responded on 28 Jul 2011 at 09:46 #

    hey,

    on my mac with osx it’s
    otool -t -v /path/to/libABC.so

Trackback URI | Comments RSS

Leave a Reply