← 返回命令列表

Linux command

llvm-nm 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List symbols in object file

llvm-nm [file.o]

Show only external symbols

llvm-nm --extern-only [file.o]

Show only undefined symbols

llvm-nm --undefined-only [file.o]

Show symbol sizes

llvm-nm --print-size [file.o]

Demangle C++ symbols

llvm-nm --demangle [file.o]

说明

llvm-nm lists symbols from object files, archives, and executables. Drop-in replacement for GNU nm. Shows symbol names, types, and addresses. Useful for debugging linking issues and understanding binary contents.

参数

--extern-only
Show only external symbols.
--undefined-only
Show only undefined symbols.
--defined-only
Show only defined symbols.
--demangle
Demangle C++ symbol names.
--print-size
Show symbol sizes.
--no-sort
Don't sort output.
--numeric-sort
Sort by address.

FAQ

What is the llvm-nm command used for?

llvm-nm lists symbols from object files, archives, and executables. Drop-in replacement for GNU nm. Shows symbol names, types, and addresses. Useful for debugging linking issues and understanding binary contents.

How do I run a basic llvm-nm example?

Run `llvm-nm [file.o]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --extern-only do in llvm-nm?

Show only external symbols.