How to view symbols in object files?

nakiya picture nakiya · Oct 7, 2010 · Viewed 84.4k times · Source

How can I view symbols in a .o file? nm does not work for me. I use g++/linux.

Answer

DarkDust picture DarkDust · Oct 7, 2010

Instead of nm, you can use the powerful objdump. See the man page for details. Try objdump -t myfile or objdump -T myfile. With the -C flag you can also demangle C++ names, like nm does.