LLVM-NM(1)

๐Ÿ’… LLVM-NM(1) โ€” the llvm-nm manual, but make it make sense

okay bestie so this is the llvm-nm page from the LLVM manual, and I'm gonna walk you through it like we're texting at 2am ๐Ÿซถ


โœจ NAME โœจ

llvm-nm โ€” literally just lists the symbol table of LLVM bitcode files and object files. that's the whole job. icon behavior tbh ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

llvm-nm [options] [filenames...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the llvm-nm utility lists the names of symbols from LLVM bitcode files, object files, and archives. every symbol gets listed along with some simple info about where it came from โ€” like a little provenance receipt, we love to see it โœจ

if you don't specify a filename, a.out is used as the input (yes, default behavior, she's confident). and if you use - as a filename, llvm-nm will read a file from its standard input stream. cute ๐Ÿ’–

llvm-nm's default output format is the traditional BSD nm output format. each such output record is made of an (optional) 8-digit hexadecimal address, then a type code character, then a name, for each symbol. one record per line, fields separated by spaces. and when the address is omitted? it gets replaced by 8 spaces. not 7, not 9. 8. periodt ๐Ÿ’€


๐ŸŽ€ the type code characters (iykyk) ๐ŸŽ€

these are the supported type code characters. where both lower and upper-case characters are listed for the same meaning: a lower-case character represents a local symbol, whilst an upper-case character represents a global (external) symbol. lowercase = local, uppercase = global, write it down bestie ๐Ÿ“

  • a, A โ€” Absolute symbol.
  • b, B โ€” Uninitialized data (bss) object.
  • C โ€” Common symbol. Multiple definitions link together into one definition.
  • d, D โ€” Writable data object.
  • i, I โ€” COFF: .idata symbol or symbol in a section with IMAGE_SCN_LNK_INFO set.
  • n โ€” ELF: local symbol from non-alloc section. COFF: debug symbol.
  • N โ€” ELF: debug section symbol, or global symbol from non-alloc section.
  • s, S โ€” COFF: section symbol. Mach-O: absolute symbol or symbol from a section other than __TEXT_EXEC __text, __TEXT __text, __DATA __data, or __DATA __bss.
  • r, R โ€” Read-only data object.
  • t, T โ€” Code (text) object.
  • u โ€” ELF: GNU unique symbol.
  • U โ€” Named object is undefined in this file.
  • v โ€” ELF: Undefined weak object. It is not a link failure if the object is not defined.
  • V โ€” ELF: Defined weak object symbol. This definition will only be used if no regular definitions exist in a link. If multiple weak definitions and no regular definitions exist, one of the weak definitions will be used.
  • w โ€” Undefined weak symbol other than an ELF object symbol. It is not a link failure if the symbol is not defined.
  • W โ€” Defined weak symbol other than an ELF object symbol. This definition will only be used if no regular definitions exist in a link. If multiple weak definitions and no regular definitions exist, one of the weak definitions will be used.
  • - โ€” Mach-O: N_STAB symbol.
  • ? โ€” Something unrecognizable.

๐Ÿงš the bitcode address thing (important!!) ๐Ÿงš

because LLVM bitcode files typically contain objects that are not considered to have addresses until they are linked into an executable image or dynamically compiled "just-in-time", llvm-nm does not print an address for any symbol in an LLVM bitcode file โ€” even symbols which are defined in the bitcode file. no address for you, bitcode. it's giving "no thoughts, head empty" but for addresses ๐ŸŒˆ


๐Ÿ”ฅ OPTIONS ๐Ÿ”ฅ

  • -B โ€” Use BSD output format. Alias for --format=bsd.
  • -X โ€” Specify the type of XCOFF object file, ELF object file, or IR object file input from command line or from archive files that llvm-nm should examine. The mode must be one of the following:
    • 32 โ€” Process only 32-bit object files.
    • 64 โ€” Process only 64-bit object files.
    • 32_64 โ€” Process both 32-bit and 64-bit object files.
    • any โ€” Process all the supported object files.

On AIX OS, the default is to process 32-bit object files only and to ignore 64-bit objects. The can be changed by setting the OBJECT_MODE environment variable. For example, OBJECT_MODE=64 causes llvm-nm to process 64-bit objects and ignore 32-bit objects. The -X flag overrides the OBJECT_MODE variable.

On other operating systems, the default is to process all object files: the OBJECT_MODE environment variable is not supported.

  • --debug-syms, -a โ€” Show all symbols, even those usually suppressed.
  • --defined-only, -U โ€” Print only symbols defined in this file.
  • --demangle, -C โ€” Demangle symbol names.
  • --dynamic, -D โ€” Display dynamic symbols instead of normal symbols.
  • --export-symbols โ€” Print sorted symbols with their visibility (if applicable), with duplicates removed.
  • --extern-only, -g โ€” Print only symbols whose definitions are external; that is, accessible from other files.
  • --format=<format>, -f โ€” Select an output format; format may be sysv, posix, darwin, bsd or just-symbols. The default is bsd.
  • --help, -h โ€” Print a summary of command-line options and their meanings.
  • -j โ€” Print just the symbol names. Alias for --format=just-symbols.
  • --line-numbers, -l โ€” Use debugging information to print the filenames and line numbers where symbols are defined. Undefined symbols have the location of their first relocation printed instead.
  • -m โ€” Use Darwin format. Alias for --format=darwin.
  • --no-demangle โ€” Don't demangle symbol names. This is the default.
  • --no-llvm-bc โ€” Disable the LLVM bitcode reader.
  • --no-sort, -p โ€” Show symbols in the order encountered.
  • --no-weak, -W โ€” Don't print weak symbols.
  • --numeric-sort, -n, -v โ€” Sort symbols by address.
  • --portability, -P โ€” Use POSIX.2 output format. Alias for --format=posix.
  • --print-armap โ€” Print the archive symbol table, in addition to the symbols.
  • --print-file-name, -A, -o โ€” Precede each symbol with the file it came from.
  • --print-size, -S โ€” Show symbol size as well as address (not applicable for Mach-O).
  • --quiet โ€” Suppress 'no symbols' diagnostic.
  • --radix=<RADIX>, -t โ€” Specify the radix of the symbol address(es). Values accepted are d (decimal), x (hexadecimal) and o (octal).
  • --reverse-sort, -r โ€” Sort symbols in reverse order.
  • --size-sort โ€” Sort symbols by size.
  • --special-syms โ€” Do not filter special symbols from the output.
  • --undefined-only, -u โ€” Print only undefined symbols.
  • --version, -V โ€” Display the version of the llvm-nm executable, then exit. Does not stack with other commands.
  • @<FILE> โ€” Read command-line options from response file <FILE>.

๐Ÿ“ MACH-O SPECIFIC OPTIONS ๐Ÿ“

apple girlies this section is for you ๐Ÿ’–

  • --add-dyldinfo โ€” Add symbols from the dyldinfo, if they are not already in the symbol table. This is the default.
  • --add-inlinedinfo โ€” Add symbols from the inlined libraries, TBD file inputs only.
  • --arch=<arch1[,arch2,...]> โ€” Dump the symbols from the specified architecture(s).
  • --dyldinfo-only โ€” Dump only symbols from the dyldinfo.
  • --no-dyldinfo โ€” Do not add any symbols from the dyldinfo.
  • -s <segment> <section> โ€” Dump only symbols from this segment and section name.
  • -x โ€” Print symbol entry in hex.

๐Ÿ’œ XCOFF SPECIFIC OPTIONS ๐Ÿ’œ

  • --no-rsrc โ€” Exclude resource file symbols (__rsrc) from export symbol list.

๐Ÿ’€ BUGS ๐Ÿ’€

  • llvm-nm does not support the full set of arguments that GNU nm does.

like she's doing her best, okay ๐Ÿ˜ญ not a full GNU clone, just living her truth


โญ EXIT STATUS โญ

llvm-nm exits with an exit code of zero.

no cap. zero. every time. iconic, honestly ๐Ÿ‘‘


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

go read your other tools bestie, they're all slaying in their own lanes ๐Ÿซถ


๐Ÿ‘‘ Author ๐Ÿ‘‘

Maintained by the LLVM Team (https://llvm.org/).

2003-2026, LLVM Project


okay that's the whole page!! and for the cute sign-off: this edition is version 23, dated 2026-10-20, brought to you by the LLVM project โ€” mwah, go compile something beautiful ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • arch rolling: llvm 23.1.4-1 ยท Apache-2.0 WITH LLVM-exception
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms