Search code examples
clinkersymbol-table

How to print the symbol table of a c program in ubuntu?


When compiling a C program the compiler/linker will generate a symbol table. How can we print that symbol table and what values it will store in the terminal?


Solution

  • You can view the symbols of a compiled program or object file with nm(1):

    nm a.out
    

    Displays all symbols in a.out.