Search code examples
c++linuxg++object-files

How to view symbols in object files?


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


Solution

  • 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.