NM(1)
๐ NM(1) ๐ โ list symbols from object files
okay so bestie, welcome to nm from the GNU Development Tools! It's literally the tool that lists symbols from object files, and it's giving main character energy for all your binary-inspection needs. No cap. ๐ซถ
โจ NAME โจ
nm โ list symbols from object files
๐ฆ SYNOPSIS ๐ฆ
nm [-A|-o|--print-file-name]
[-a|--debug-syms]
[-B|--format=bsd]
[-C|--demangle[=style]]
[-D|--dynamic]
[-fformat|--format=format]
[-g|--extern-only]
[-h|--help]
[--ifunc-chars=CHARS]
[-j|--format=just-symbols]
[-l|--line-numbers] [--inlines]
[-n|-v|--numeric-sort]
[-P|--portability]
[-p|--no-sort]
[-r|--reverse-sort]
[-S|--print-size]
[-s|--print-armap]
[-t radix|--radix=radix]
[-u|--undefined-only]
[-U|--defined-only]
[-V|--version]
[-W|--no-weak]
[-X 32_64]
[--no-demangle]
[--no-recurse-limit|--recurse-limit]]
[--plugin name]
[--size-sort]
[--special-syms]
[--synthetic]
[--target=bfdname]
[--unicode=method]
[--with-symbol-versions]
[--without-symbol-versions]
[objfile...]
๐ธ DESCRIPTION ๐ธ
GNU nm lists the symbols from object files objfile.... If no object files are listed as arguments, nm assumes the file a.out.
For each symbol, nm shows:
- The symbol value โ in the radix selected by options (see below), or hexadecimal by default.
- The symbol type โ At least the following types are used; others are, as well, depending on the object file format. If lowercase, the symbol is usually local; if uppercase, the symbol is global (external). There are however a few lowercase symbols that are shown for special global symbols (
u,vandw).Aโ The symbol's value is absolute, and will not be changed by further linking.B,bโ The symbol is in the BSS data section. This section typically contains zero-initialized or uninitialized data, although the exact behavior is system dependent.C,cโ The symbol is common. Common symbols are uninitialized data. When linking, multiple common symbols may appear with the same name. If the symbol is defined anywhere, the common symbols are treated as undefined references. The lower caseccharacter is used when the symbol is in a special section for small commons.D,dโ The symbol is in the initialized data section.G,gโ The symbol is in an initialized data section for small objects. Some object file formats permit more efficient access to small data objects, such as a globalintvariable as opposed to a large global array.iโ For PE format files this indicates that the symbol is in a section specific to the implementation of DLLs.
For ELF format files this indicates that the symbol is an indirect function. This is a GNU extension to the standard set of ELF symbol types. It indicates a symbol which if referenced by a relocation does not evaluate to its address, but instead must be invoked at runtime. The runtime execution will then return the value to be used in the relocation.
Note - the actual symbols display for GNU indirect symbols is controlled by the --ifunc-chars command line option. If this option has been provided then the first character in the string will be used for global indirect function symbols. If the string contains a second character then that will be used for local indirect function symbols.
Iโ The symbol is an indirect reference to another symbol.Nโ The symbol is a debugging symbol.nโ The symbol is in a non-data, non-code, non-debug read-only section.pโ The symbol is in a stack unwind section.R,rโ The symbol is in a read only data section.S,sโ The symbol is in an uninitialized or zero-initialized data section for small objects.T,tโ The symbol is in the text (code) section.Uโ The symbol is undefined.uโ The symbol is a unique global symbol. This is a GNU extension to the standard set of ELF symbol bindings. For such a symbol the dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use.V,vโ The symbol is a weak object. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the weak symbol becomes zero with no error. On some systems, uppercase indicates that a default value has been specified.W,wโ The symbol is a weak symbol that has not been specifically tagged as a weak object symbol. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the symbol is determined in a system-specific manner without error. On some systems, uppercase indicates that a default value has been specified.-โ The symbol is a stabs symbol in an a.out object file. In this case, the next values printed are the stabs other field, the stabs desc field, and the stab type. Stabs symbols are used to hold debugging information.?โ The symbol type is unknown, or object file format specific.
- The symbol name โ If a symbol has version information associated with it, then the version information is displayed as well. If the versioned symbol is undefined or hidden from linker, the version string is displayed as a suffix to the symbol name, preceded by an
@character. For examplefoo@VER_1. If the version is the default version to be used when resolving unversioned references to the symbol, then it is displayed as a suffix preceded by two@characters. For examplefoo@@VER_2.
โจ OPTIONS โจ
okay bestie, real talk โ the long and short forms of options are shown here as alternatives, and they are equivalent. pick whichever one your fingers vibe with. ๐
-A,-o,--print-file-nameโ puts the name of the input file (or the archive member) right before each symbol it was found in. so instead of naming the input file one single time at the top before all its symbols, you get it stamped on every line. obsessed with the specificity honestly.-a,--debug-symsโ shows you all the symbols, even the debugger-only ones. normally those do not get listed. this is the "no secrets in this house" option. ๐-Bโ literally just the same as--format=bsd. it exists for compatibility with the MIPSnm. that's it, that's the whole thing.-C,--demangle[=style]โ decodes (demangles) low-level symbol names into user-level names. besides stripping any initial underscore that the system prepended, this is what makes C++ function names actually readable. different compilers mangle in different styles, so the optional style argument lets you pick the right demangling style for your compiler. it's giving translator. ๐--no-demangleโ do not demangle low-level symbol names. this is the default, bestie. the raw form is what you get unless you ask otherwise.--recurse-limit,--no-recurse-limit,--recursion-limit,--no-recursion-limitโ turns a limit on the amount of recursion done while demangling on or off. here's the tea: name mangling formats allow for infinite levels of recursion, so it's genuinely possible to craft strings whose decoding will exhaust all the stack space on your host machine and trigger a memory fault. the limit tries to stop that by restricting recursion to 2048 levels of nesting.
the default is for the limit to be enabled, but disabling it may be necessary if you need to demangle truly complicated names. that said โ and this is important โ if you disable the recursion limit then stack exhaustion is possible and any bug reports about that happening will be rejected. you've been warned, gorgeous. ๐
-D,--dynamicโ shows the dynamic symbols instead of the normal symbols. this is only meaningful for dynamic objects, like certain types of shared libraries. โจ-fformat,--format=format โ uses the output format format, which can be"bsd","sysv","posix"or"just-symbols". the default is"bsd". only the *first character of *format is significant, and it can be upper or lower case. slay, efficiency.-g,--extern-onlyโ shows only external symbols. keep it exclusive. ๐-h,--helpโ shows a summary of the options tonmand exits. your lil cheat sheet.--ifunc-chars=CHARS โ when displaying GNU indirect function symbols,nmdefaults to using the"i"character for both local indirect functions and global indirect functions. this option lets you specify a string with **one or two characters. the first character is used for global indirect function symbols, and the second character, if present, is used for local indirect function symbols. customize your little letters, bestie. ๐-jโ the same as--format=just-symbols. short and sweet.-l,--line-numbersโ for each symbol, uses debugging information to try to find a filename and line number. for a defined symbol, it looks for the line number of the address of the symbol. for an undefined symbol, it looks for the line number of a relocation entry that refers to the symbol. if line number info can be found, it gets printed after the other symbol information. detective mode activated ๐--inlinesโ when-lis active, if the address belongs to a function that was inlined, this makes the source information for all the enclosing scopes back to the first non-inlined function get printed too. for example, if"main"inlines"callee1"which inlines"callee2", and the address is from"callee2", then the source information for"callee1"and"main"will also be printed. it's giving family tree. ๐ธ-n,-v,--numeric-sortโ sorts symbols numerically by their addresses, instead of alphabetically by their names. numbers girlies rise ๐ซถ-p,--no-sortโ doesn't bother sorting the symbols in any order at all; prints them in the order encountered. chaos, but make it intentional. ๐-P,--portabilityโ uses the POSIX.2 standard output format instead of the default one. equivalent to-f posix.-r,--reverse-sortโ reverses the order of the sort (numeric or alphabetic, whichever you're doing); lets the last come first. main character energy for the final symbol. ๐ฅ-S,--print-sizeโ prints both value and size of defined symbols for the"bsd"output style. this option has no effect for object formats that don't record symbol sizes, unless--size-sortis also used, in which case a calculated size is displayed. iykyk.-s,--print-armapโ when listing symbols from archive members, includes the index: a mapping (stored in the archive byarorranlib) of which modules contain definitions for which names. the receipts, basically. ๐งพ- *
-t*radix,--radix=radix โ uses radix as the radix for printing symbol values. it must bedfor decimal,ofor octal, orxfor hexadecimal. pick your base, bestie. -u,--undefined-onlyโ shows only undefined symbols (the ones external to each object file). by default, both defined and undefined symbols are displayed.-U,--defined-onlyโ shows only defined symbols for each object file. by default, both defined and undefined symbols are displayed. yes, this is the mirror of-u, and yes, they are iconic for it.-V,--versionโ shows the version number ofnmand exits. quick lil flex.-Xโ this option is ignored, for compatibility with the AIX version ofnm. it takes one parameter which must be the string32_64. the default mode of AIXnmcorresponds to-X 32, which is not supported by GNUnm. so yeah, it does nothing here. ghosted. ๐ป- *
--plugin*name โ loads the plugin called name to add support for extra target types. this option is only available if the toolchain was built with plugin support enabled.
if --plugin isn't provided but plugin support has been enabled, then nm iterates over the files in ${libdir}/bfd-plugins in alphabetic order, and the first plugin that claims the object in question is used.
please note that this plugin search directory is not the one used byld's-pluginoption. to makenmuse the linker plugin, it must be copied into the${libdir}/bfd-pluginsdirectory. for GCC based compilations the linker plugin is calledliblto_plugin.so.0.0.0. for Clang based compilations it is calledLLVMgold.so. the GCC plugin is always backwards compatible with earlier versions, so it's sufficient to just copy the newest one. ๐
--size-sortโ sorts symbols by size. for ELF objects, symbol sizes are read from the ELF; for other object types the symbol sizes are computed as the difference between the value of the symbol and the value of the symbol with the next higher value. if the"bsd"output format is used, the size of the symbol is printed rather than the value, and-Smust be used in order for both size and value to be printed.
note โ this option does not work if --undefined-only has been enabled, because undefined symbols have no size. ๐ญ
--special-symsโ displays symbols that have a target-specific special meaning. these symbols are usually used by the target for some special processing and aren't normally helpful when included in the normal symbol lists. for example, for ARM targets this option would skip the mapping symbols used to mark transitions between ARM code, THUMB code and data. niche but valid. โจ--syntheticโ includes synthetic symbols in the output. these are special symbols created by the linker for various purposes. they're not shown by default since they're not part of the binary's original source code. lore, not canon. ๐--unicode=[default|invalid|locale|escape|hex|highlight]โ controls the display of UTF-8 encoded multibyte characters in strings. the default (--unicode=default) is to give them no special treatment. the--unicode=localeoption displays the sequence in the current locale, which may or may not support them. the options--unicode=hexand--unicode=invaliddisplay them as hex byte sequences enclosed by either angle brackets or curly braces.
the --unicode=escape option displays them as escape sequences (\uxxxx), and the --unicode=highlight option displays them as escape sequences highlighted in red (if supported by the output device). the colouring is meant to draw attention to the presence of unicode sequences where they might not be expected. ๐จ
-W,--no-weakโ does not display weak symbols. we only want the strong ones here. ๐ช--with-symbol-versions,--without-symbol-versionsโ enables or disables the display of symbol version information. the version string is displayed as a suffix to the symbol name, preceded by an@character. for examplefoo@VER_1. if the version is the default version used when resolving unversioned references to the symbol, then it's displayed as a suffix preceded by two@characters. for examplefoo@@VER_2. by default, symbol version information is displayed.- *
--target=bfdname* โ specifies an object code format other than your system's default format. @file โ reads command-line options from file. the options read are inserted in place of the original@file option. if file doesn't exist, or can't be read, then the option is treated **literally, and not removed.
options in file are separated by whitespace. a whitespace character can be included in an option by surrounding the entire option in either single or double quotes. any character (including a backslash) can be included by prefixing the character to be included with a backslash. the file may itself contain additional @file options; any such options will be processed recursively. it's files all the way down. ๐
๐ SEE ALSO ๐
ar(1), objdump(1), ranlib(1), and the Info entries for binutils. go read the friends of nm, they're all slaying in their own lanes. ๐ซถ
๐ COPYRIGHT ๐
Copyright (c) 1991-2026 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
and that's the whole page, bestie!! ๐ this was binutils-2.47, dated 2026-08-11, and it lives at NM(1). go forth and read your symbols, you absolute icon. ๐โจ๐
๐ฆ where this page comes from
- arch rolling: binutils 2.47-4 ยท GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3 AND FSFAP
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms