1LLVM-NM(1)                           LLVM                           LLVM-NM(1)
2
3
4

NAME

6       llvm-nm - list LLVM bitcode and object file's symbol table
7

SYNOPSIS

9       llvm-nm [options] [filenames...]
10

DESCRIPTION

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
100       image 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

OPTIONS

105       -B     Use BSD output format. Alias for --format=bsd.
106
107       --debug-syms, -a
108              Show all symbols, even those usually suppressed.
109
110       --defined-only, -U
111              Print only symbols defined in this file.
112
113       --demangle, -C
114              Demangle symbol names.
115
116       --dynamic, -D
117              Display dynamic symbols instead of normal symbols.
118
119       --extern-only, -g
120              Print  only  symbols  whose  definitions  are external; that is,
121              accessible from other files.
122
123       --format=<format>, -f
124              Select an output format; format may be sysv, posix,  darwin,  or
125              bsd.  The default is bsd.
126
127       --help, -h
128              Print a summary of command-line options and their meanings.
129
130       --help-list
131              Print an uncategorized summary of command-line options and their
132              meanings.
133
134       --just-symbol-name, -j
135              Print just the symbol names.
136
137       -m     Use Darwin format. Alias for --format=darwin.
138
139       --no-demangle
140              Don't demangle symbol names. This is the default.
141
142       --no-llvm-bc
143              Disable the LLVM bitcode reader.
144
145       --no-sort, -p
146              Show symbols in the order encountered.
147
148       --no-weak, -W
149              Don't print weak symbols.
150
151       --numeric-sort, -n, -v
152              Sort symbols by address.
153
154       --portability, -P
155              Use POSIX.2 output format.  Alias for --format=posix.
156
157       --print-armap, -M
158              Print the archive symbol table, in addition to the symbols.
159
160       --print-file-name, -A, -o
161              Precede each symbol with the file it came from.
162
163       --print-size, -S
164              Show symbol size as well as address (not applicable for Mach-O).
165
166       --radix=<RADIX>, -t
167              Specify the radix of the symbol address(es). Values accepted are
168              d (decimal), x (hexadecimal) and o (octal).
169
170       --reverse-sort, -r
171              Sort symbols in reverse order.
172
173       --size-sort
174              Sort symbols by size.
175
176       --special-syms
177              Do not filter special symbols from the output.
178
179       --undefined-only, -u
180              Print only undefined symbols.
181
182       --version
183              Display  the  version  of the llvm-nm executable. Does not stack
184              with other commands.
185
186       --without-aliases
187              Exclude aliases from the output.
188
189       @<FILE>
190              Read command-line options from response file <FILE>.
191

MACH-O SPECIFIC OPTIONS

193       --add-dyldinfo
194              Add symbols from the dyldinfo, if they are not  already  in  the
195              symbol table.  This is the default.
196
197       --add-inlinedinfo
198              Add symbols from the inlined libraries, TBD file inputs only.
199
200       --arch=<arch1[,arch2,...]>
201              Dump the symbols from the specified architecture(s).
202
203       --dyldinfo-only
204              Dump only symbols from the dyldinfo.
205
206       --no-dyldinfo
207              Do not add any symbols from the dyldinfo.
208
209       -s=<segment section>
210              Dump only symbols from this segment and section name.
211
212       -x     Print symbol entry in hex.
213

BUGS

215          · llvm-nm  does  not  support  the full set of arguments that GNU nm
216            does.
217

EXIT STATUS

219       llvm-nm exits with an exit code of zero.
220

SEE ALSO

222       llvm-ar(1), llvm-objdump(1), llvm-readelf(1), llvm-readobj(1)
223

AUTHOR

225       Maintained by the LLVM Team (https://llvm.org/).
226
228       2003-2020, LLVM Project
229
230
231
232
23311                                2020-10-15                        LLVM-NM(1)
Impressum