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 On AIX OS, the default is to process 32-bit object files only
120 and to ignore 64-bit objects. The can be changed by setting
121 the OBJECT_MODE environment variable. For example, OB‐
122 JECT_MODE=64 causes llvm-nm to process 64-bit objects and ig‐
123 nore 32-bit objects. The -X flag overrides the OBJECT_MODE
124 variable.
125
126 On other operating systems, the default is to process all ob‐
127 ject files: the OBJECT_MODE environment variable is not sup‐
128 ported.
129
130 --debug-syms, -a
131 Show all symbols, even those usually suppressed.
132
133 --defined-only, -U
134 Print only symbols defined in this file.
135
136 --demangle, -C
137 Demangle symbol names.
138
139 --dynamic, -D
140 Display dynamic symbols instead of normal symbols.
141
142 --export-symbols
143 Print sorted symbols with their visibility (if applicable), with
144 duplicates removed.
145
146 --extern-only, -g
147 Print only symbols whose definitions are external; that is, ac‐
148 cessible from other files.
149
150 --format=<format>, -f
151 Select an output format; format may be sysv, posix, darwin, bsd
152 or just-symbols. The default is bsd.
153
154 --help, -h
155 Print a summary of command-line options and their meanings.
156
157 -j Print just the symbol names. Alias for --format=just-symbols`.
158
159 -m Use Darwin format. Alias for --format=darwin.
160
161 --no-demangle
162 Don't demangle symbol names. This is the default.
163
164 --no-llvm-bc
165 Disable the LLVM bitcode reader.
166
167 --no-sort, -p
168 Show symbols in the order encountered.
169
170 --no-weak, -W
171 Don't print weak symbols.
172
173 --numeric-sort, -n, -v
174 Sort symbols by address.
175
176 --portability, -P
177 Use POSIX.2 output format. Alias for --format=posix.
178
179 --print-armap
180 Print the archive symbol table, in addition to the symbols.
181
182 --print-file-name, -A, -o
183 Precede each symbol with the file it came from.
184
185 --print-size, -S
186 Show symbol size as well as address (not applicable for Mach-O).
187
188 --quiet
189 Suppress 'no symbols' diagnostic.
190
191 --radix=<RADIX>, -t
192 Specify the radix of the symbol address(es). Values accepted are
193 d (decimal), x (hexadecimal) and o (octal).
194
195 --reverse-sort, -r
196 Sort symbols in reverse order.
197
198 --size-sort
199 Sort symbols by size.
200
201 --special-syms
202 Do not filter special symbols from the output.
203
204 --undefined-only, -u
205 Print only undefined symbols.
206
207 --version, -V
208 Display the version of the llvm-nm executable, then exit. Does
209 not stack with other commands.
210
211 @<FILE>
212 Read command-line options from response file <FILE>.
213
215 --add-dyldinfo
216 Add symbols from the dyldinfo, if they are not already in the
217 symbol table. This is the default.
218
219 --add-inlinedinfo
220 Add symbols from the inlined libraries, TBD file inputs only.
221
222 --arch=<arch1[,arch2,...]>
223 Dump the symbols from the specified architecture(s).
224
225 --dyldinfo-only
226 Dump only symbols from the dyldinfo.
227
228 --no-dyldinfo
229 Do not add any symbols from the dyldinfo.
230
231 -s <segment> <section>
232 Dump only symbols from this segment and section name.
233
234 -x Print symbol entry in hex.
235
237 --no-rsrc
238 Exclude resource file symbols (__rsrc) from export symbol list.
239
241 • llvm-nm does not support the full set of arguments that GNU nm
242 does.
243
245 llvm-nm exits with an exit code of zero.
246
248 llvm-ar(1), llvm-objdump(1), llvm-readelf(1), llvm-readobj(1)
249
251 Maintained by the LLVM Team (https://llvm.org/).
252
254 2003-2023, LLVM Project
255
256
257
258
25917 2023-11-28 LLVM-NM(1)