LLVM-NM(1)
β¨ NAME β¨
okay so welcome to the LLVM-NM(1) page bestie π β llvm-nm lists the symbol table of LLVM bitcode and object files. that's it, that's the job. she's a snoop, she's a gossip, she tells you who's in the file.
π¦ 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 its provenance, like a lil name tag at a party π. if you don't specify a filename, a.out is the input (default queen behavior). and if you use - as a filename, llvm-nm will read a file from its standard input stream. slay.
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 are separated by spaces. when the address is omitted, it's replaced by 8 spaces (not me counting the spaces, but yes, 8 of them π
).
the supported type code characters are as follows. 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:
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:.idatasymbol or symbol in a section withIMAGE_SCN_LNK_INFOset.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_STABsymbol.?β something unrecognizable. π
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, no problem, she's just built different π«Ά.
π 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 thatllvm-nmshould 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. you can change that 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, periodt.
on other operating systems, the default is to process all object files: the OBJECT_MODE environment variable is not supported there. π
--debug-syms,-aβ show all symbols, even those usually suppressed. no secrets, no hiding.--defined-only,-Uβ print only symbols defined in this file.--demangle,-Cβ demangle symbol names (so your eyes don't bleed).--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 besysv,posix,darwin,bsdorjust-symbols. the default isbsd.--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. she's not gonna nag you about it π«Ά.--radix=<RADIX>,-tβ specify the radix of the symbol address(es). values accepted ared(decimal),x(hexadecimal) ando(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 thellvm-nmexecutable, then exit. does not stack with other commands.@<FILE>β read command-line options from response file <FILE>.
π MACH-O SPECIFIC OPTIONS π
--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-nmdoes not support the full set of arguments that GNUnmdoes. ngl, she's not GNU and she's not trying to be β¨.
π₯ EXIT STATUS π₯
llvm-nm exits with an exit code of zero. iconic. no drama, no tears, just 0 π.
π SEE ALSO π
llvm-ar(1), llvm-objdump(1), llvm-readelf(1), llvm-readobj(1) β the whole friend group, go say hi.
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/).
π COPYRIGHT π
2003-2025, LLVM Project
and that's the page bestie!! this was page 20, dated 2025-09-03, from your favs over in the LLVM section of the manual π β¨ go list some symbols, you ate π«Ά
π¦ where this page comes from
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms