commands.sh

nm

all

List symbol names in object files.

More info →

Options (4)

-g, --extern-onlyboolean

List global (extern) functions in a file (prefixed with T)

Example: nm {{[-g|--extern-only]}} {{path/to/file.o}}
-u, --undefined-onlyboolean

List only undefined symbols in a file

Example: nm {{[-u|--undefined-only]}} {{path/to/file.o}}
-a, --debug-symsboolean

List all symbols, even debugging symbols

Example: nm {{[-a|--debug-syms]}} {{path/to/file.o}}
-C, --demangleboolean

Demangle C++ symbols (make them readable)

Example: nm {{[-C|--demangle]}} {{path/to/file.o}}

Examples (4)

List global (extern) functions in a file (prefixed with T)

nm [-g|--extern-only] path/to/file.o

List only undefined symbols in a file

nm [-u|--undefined-only] path/to/file.o

List all symbols, even debugging symbols

nm [-a|--debug-syms] path/to/file.o

Demangle C++ symbols (make them readable)

nm [-C|--demangle] path/to/file.o
made by @shridhargupta | data from tldr-pages