1LLVM-NM(1) LLVM LLVM-NM(1)
2
3
4
6 llvm-nm - list LLVM bitcode and object file's symbol table
7
9 llvm-nm [options] [filenames...]
10
12 The llvm-nm utility lists the names of symbols from LLVM bitcode files,
13 object files, and archives. Each symbol is listed along with some sim‐
14 ple information about its provenance. If no filename is specified,
15 a.out is used as the input. If - is used as a filename, llvm-nm will
16 read a file from its standard input stream.
17
18 llvm-nm's default output format is the traditional BSD nm output for‐
19 mat. Each such output record consists of an (optional) 8-digit hexadec‐
20 imal address, followed by a type code character, followed by a name,
21 for each symbol. One record is printed per line; fields are separated
22 by spaces. When the address is omitted, it is replaced by 8 spaces.
23
24 The supported type code characters are as follows. Where both lower and
25 upper-case characters are listed for the same meaning, a lower-case
26 character represents a local symbol, whilst an upper-case character
27 represents a global (external) symbol:
28
29 a, A
30 Absolute symbol.
31
32 b, B
33 Uninitialized data (bss) object.
34
35 C
36 Common symbol. Multiple definitions link together into one defini‐
37 tion.
38
39 d, D
40 Writable data object.
41
42 i, I
43 COFF: .idata symbol or symbol in a section with IMAGE_SCN_LNK_INFO
44 set.
45
46 n
47 ELF: local symbol from non-alloc section.
48
49 COFF: debug symbol.
50
51 N
52 ELF: debug section symbol, or global symbol from non-alloc section.
53
54 s, S
55 COFF: section symbol.
56
57 Mach-O: absolute symbol or symbol from a section other than
58 __TEXT_EXEC __text, __TEXT __text, __DATA __data, or __DATA __bss.
59
60 r, R
61 Read-only data object.
62
63 t, T
64 Code (text) object.
65
66 u
67 ELF: GNU unique symbol.
68
69 U
70 Named object is undefined in this file.
71
72 v
73 ELF: Undefined weak object. It is not a link failure if the object
74 is not defined.
75
76 V
77 ELF: Defined weak object symbol. This definition will only be used
78 if no regular definitions exist in a link. If multiple weak defini‐
79 tions and no regular definitions exist, one of the weak definitions
80 will be used.
81
82 w
83 Undefined weak symbol other than an ELF object symbol. It is not a
84 link failure if the symbol is not defined.
85
86 W
87 Defined weak symbol other than an ELF object symbol. This definition
88 will only be used if no regular definitions exist in a link. If mul‐
89 tiple weak definitions and no regular definitions exist, one of the
90 weak definitions will be used.
91
92 -
93 Mach-O: N_STAB symbol.
94
95 ?
96 Something unrecognizable.
97
98 Because LLVM bitcode files typically contain objects that are not con‐
99 sidered to have addresses until they are linked into an executable im‐
100 age or dynamically compiled "just-in-time", llvm-nm does not print an
101 address for any symbol in an LLVM bitcode file, even symbols which are
102 defined in the bitcode file.
103
105 -B Use BSD output format. Alias for --format=bsd.
106
107 -X Specify the type of XCOFF object file, ELF object file, or IR
108 object file input from command line or from archive files that
109 llvm-nm should examine. The mode must be one of the following:
110
111 32 Process only 32-bit object files.
112
113 64 Process only 64-bit object files.
114
115 32_64 Process both 32-bit and 64-bit object files.
116
117 any Process all the supported object files.
118
119 --debug-syms, -a
120 Show all symbols, even those usually suppressed.
121
122 --defined-only, -U
123 Print only symbols defined in this file.
124
125 --demangle, -C
126 Demangle symbol names.
127
128 --dynamic, -D
129 Display dynamic symbols instead of normal symbols.
130
131 --export-symbols
132 Print sorted symbols with their visibility (if applicable), with
133 duplicates removed.
134
135 --extern-only, -g
136 Print only symbols whose definitions are external; that is, ac‐
137 cessible from other files.
138
139 --format=<format>, -f
140 Select an output format; format may be sysv, posix, darwin, bsd
141 or just-symbols. The default is bsd.
142
143 --help, -h
144 Print a summary of command-line options and their meanings.
145
146 -j Print just the symbol names. Alias for --format=just-symbols`.
147
148 -m Use Darwin format. Alias for --format=darwin.
149
150 --no-demangle
151 Don't demangle symbol names. This is the default.
152
153 --no-llvm-bc
154 Disable the LLVM bitcode reader.
155
156 --no-sort, -p
157 Show symbols in the order encountered.
158
159 --no-weak, -W
160 Don't print weak symbols.
161
162 --numeric-sort, -n, -v
163 Sort symbols by address.
164
165 --portability, -P
166 Use POSIX.2 output format. Alias for --format=posix.
167
168 --print-armap
169 Print the archive symbol table, in addition to the symbols.
170
171 --print-file-name, -A, -o
172 Precede each symbol with the file it came from.
173
174 --print-size, -S
175 Show symbol size as well as address (not applicable for Mach-O).
176
177 --quiet
178 Suppress 'no symbols' diagnostic.
179
180 --radix=<RADIX>, -t
181 Specify the radix of the symbol address(es). Values accepted are
182 d (decimal), x (hexadecimal) and o (octal).
183
184 --reverse-sort, -r
185 Sort symbols in reverse order.
186
187 --size-sort
188 Sort symbols by size.
189
190 --special-syms
191 Do not filter special symbols from the output.
192
193 --undefined-only, -u
194 Print only undefined symbols.
195
196 --version, -V
197 Display the version of the llvm-nm executable, then exit. Does
198 not stack with other commands.
199
200 @<FILE>
201 Read command-line options from response file <FILE>.
202
204 --add-dyldinfo
205 Add symbols from the dyldinfo, if they are not already in the
206 symbol table. This is the default.
207
208 --add-inlinedinfo
209 Add symbols from the inlined libraries, TBD file inputs only.
210
211 --arch=<arch1[,arch2,...]>
212 Dump the symbols from the specified architecture(s).
213
214 --dyldinfo-only
215 Dump only symbols from the dyldinfo.
216
217 --no-dyldinfo
218 Do not add any symbols from the dyldinfo.
219
220 -s <segment> <section>
221 Dump only symbols from this segment and section name.
222
223 -x Print symbol entry in hex.
224
226 --no-rsrc
227 Exclude resource file symbols (__rsrc) from export symbol list.
228
230 • llvm-nm does not support the full set of arguments that GNU nm
231 does.
232
234 llvm-nm exits with an exit code of zero.
235
237 llvm-ar(1), llvm-objdump(1), llvm-readelf(1), llvm-readobj(1)
238
240 Maintained by the LLVM Team (https://llvm.org/).
241
243 2003-2023, LLVM Project
244
245
246
247
24815 2023-03-27 LLVM-NM(1)