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, v and w).
    • 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 case c character 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 global int variable 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 example foo@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 example foo@@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 MIPS nm. 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. โœจ
  • -f format, --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 to nm and exits. your lil cheat sheet.
  • --ifunc-chars=CHARS โ€” when displaying GNU indirect function symbols, nm defaults 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 -l is 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-sort is 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 by ar or ranlib) 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 be d for decimal, o for octal, or x for 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 of nm and exits. quick lil flex.
  • -X โ€” this option is ignored, for compatibility with the AIX version of nm. it takes one parameter which must be the string 32_64. the default mode of AIX nm corresponds to -X 32, which is not supported by GNU nm. 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 by ld's -plugin option. to make nm use the linker plugin, it must be copied into the ${libdir}/bfd-plugins directory. for GCC based compilations the linker plugin is called liblto_plugin.so.0.0.0. for Clang based compilations it is called LLVMgold.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 -S must 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=locale option displays the sequence in the current locale, which may or may not support them. the options --unicode=hex and --unicode=invalid display 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 example foo@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 example foo@@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 (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