1 llvm-nm - list LLVM bitcode and object file's symbol table
2 ==========================================================
9 :program:`llvm-nm` [*options*] [*filenames...*]
14 The :program:`llvm-nm` utility lists the names of symbols from LLVM bitcode
15 files, object files, and archives. Each symbol is listed along with some simple
16 information about its provenance. If no filename is specified, *a.out* is used
17 as the input. If *-* is used as a filename, :program:`llvm-nm` will read a file
18 from its standard input stream.
20 :program:`llvm-nm`'s default output format is the traditional BSD :program:`nm`
21 output format. Each such output record consists of an (optional) 8-digit
22 hexadecimal address, followed by a type code character, followed by a name, for
23 each symbol. One record is printed per line; fields are separated by spaces.
24 When the address is omitted, it is replaced by 8 spaces.
26 The supported type code characters are as follows. Where both lower and
27 upper-case characters are listed for the same meaning, a lower-case character
28 represents a local symbol, whilst an upper-case character represents a global
37 Uninitialized data (bss) object.
41 Common symbol. Multiple definitions link together into one definition.
49 COFF: .idata symbol or symbol in a section with IMAGE_SCN_LNK_INFO set.
53 ELF: local symbol from non-alloc section.
59 ELF: debug section symbol, or global symbol from non-alloc section.
65 Mach-O: absolute symbol or symbol from a section other than __TEXT_EXEC __text,
66 __TEXT __text, __DATA __data, or __DATA __bss.
70 Read-only data object.
78 ELF: GNU unique symbol.
82 Named object is undefined in this file.
86 ELF: Undefined weak object. It is not a link failure if the object is not
91 ELF: Defined weak object symbol. This definition will only be used if no
92 regular definitions exist in a link. If multiple weak definitions and no
93 regular definitions exist, one of the weak definitions will be used.
97 Undefined weak symbol other than an ELF object symbol. It is not a link failure
98 if the symbol is not defined.
102 Defined weak symbol other than an ELF object symbol. This definition will only
103 be used if no regular definitions exist in a link. If multiple weak definitions
104 and no regular definitions exist, one of the weak definitions will be used.
108 Mach-O: N_STAB symbol.
112 Something unrecognizable.
114 Because LLVM bitcode files typically contain objects that are not considered to
115 have addresses until they are linked into an executable image or dynamically
116 compiled "just-in-time", :program:`llvm-nm` does not print an address for any
117 symbol in an LLVM bitcode file, even symbols which are defined in the bitcode
127 Use BSD output format. Alias for ``--format=bsd``.
129 .. option:: --debug-syms, -a
131 Show all symbols, even those usually suppressed.
133 .. option:: --defined-only, -U
135 Print only symbols defined in this file.
137 .. option:: --demangle, -C
139 Demangle symbol names.
141 .. option:: --dynamic, -D
143 Display dynamic symbols instead of normal symbols.
145 .. option:: --extern-only, -g
147 Print only symbols whose definitions are external; that is, accessible from
150 .. option:: --format=<format>, -f
152 Select an output format; *format* may be *sysv*, *posix*, *darwin*, or *bsd*.
153 The default is *bsd*.
155 .. option:: --help, -h
157 Print a summary of command-line options and their meanings.
159 .. option:: --help-list
161 Print an uncategorized summary of command-line options and their meanings.
163 .. option:: --just-symbol-name, -j
165 Print just the symbol names.
169 Use Darwin format. Alias for ``--format=darwin``.
171 .. option:: --no-demangle
173 Don't demangle symbol names. This is the default.
175 .. option:: --no-llvm-bc
177 Disable the LLVM bitcode reader.
179 .. option:: --no-sort, -p
181 Show symbols in the order encountered.
183 .. option:: --no-weak, -W
185 Don't print weak symbols.
187 .. option:: --numeric-sort, -n, -v
189 Sort symbols by address.
191 .. option:: --portability, -P
193 Use POSIX.2 output format. Alias for ``--format=posix``.
195 .. option:: --print-armap, -M
197 Print the archive symbol table, in addition to the symbols.
199 .. option:: --print-file-name, -A, -o
201 Precede each symbol with the file it came from.
203 .. option:: --print-size, -S
205 Show symbol size as well as address (not applicable for Mach-O).
207 .. option:: --radix=<RADIX>, -t
209 Specify the radix of the symbol address(es). Values accepted are *d* (decimal),
210 *x* (hexadecimal) and *o* (octal).
212 .. option:: --reverse-sort, -r
214 Sort symbols in reverse order.
216 .. option:: --size-sort
218 Sort symbols by size.
220 .. option:: --special-syms
222 Ignored. For GNU compatibility only.
224 .. option:: --undefined-only, -u
226 Print only undefined symbols.
228 .. option:: --version
230 Display the version of the :program:`llvm-nm` executable. Does not stack with
233 .. option:: --without-aliases
235 Exclude aliases from the output.
239 Read command-line options from response file `<FILE>`.
241 MACH-O SPECIFIC OPTIONS
242 -----------------------
244 .. option:: --add-dyldinfo
246 Add symbols from the dyldinfo, if they are not already in the symbol table.
249 .. option:: --arch=<arch1[,arch2,...]>
251 Dump the symbols from the specified architecture(s).
253 .. option:: --dyldinfo-only
255 Dump only symbols from the dyldinfo.
257 .. option:: --no-dyldinfo
259 Do not add any symbols from the dyldinfo.
261 .. option:: -s=<segment section>
263 Dump only symbols from this segment and section name.
267 Print symbol entry in hex.
272 * :program:`llvm-nm` does not support the full set of arguments that GNU
278 :program:`llvm-nm` exits with an exit code of zero.
283 :manpage:`llvm-ar(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`,
284 :manpage:`llvm-readobj(1)`