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

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
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, ac‐
121              cessible from other files.
122
123       --format=<format>, -f
124              Select an output format; format may be sysv, posix, darwin,  bsd
125              or just-symbols.  The default is bsd.
126
127       --help, -h
128              Print a summary of command-line options and their meanings.
129
130       -j     Print just the symbol names. Alias for --format=just-symbols`.
131
132       -m     Use Darwin format. Alias for --format=darwin.
133
134       --no-demangle
135              Don't demangle symbol names. This is the default.
136
137       --no-llvm-bc
138              Disable the LLVM bitcode reader.
139
140       --no-sort, -p
141              Show symbols in the order encountered.
142
143       --no-weak
144              Don't print weak symbols.
145
146       --numeric-sort, -n, -v
147              Sort symbols by address.
148
149       --portability, -P
150              Use POSIX.2 output format.  Alias for --format=posix.
151
152       --print-armap
153              Print the archive symbol table, in addition to the symbols.
154
155       --print-file-name, -A, -o
156              Precede each symbol with the file it came from.
157
158       --print-size, -S
159              Show symbol size as well as address (not applicable for Mach-O).
160
161       --quiet
162              Suppress 'no symbols' diagnostic.
163
164       --radix=<RADIX>, -t
165              Specify the radix of the symbol address(es). Values accepted are
166              d (decimal), x (hexadecimal) and o (octal).
167
168       --reverse-sort, -r
169              Sort symbols in reverse order.
170
171       --size-sort
172              Sort symbols by size.
173
174       --special-syms
175              Do not filter special symbols from the output.
176
177       --undefined-only, -u
178              Print only undefined symbols.
179
180       --version, -V
181              Display the version of the llvm-nm executable, then  exit.  Does
182              not stack with other commands.
183
184       @<FILE>
185              Read command-line options from response file <FILE>.
186

MACH-O SPECIFIC OPTIONS

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

BUGS

210llvm-nm does not support the full set of  arguments  that  GNU  nm
211            does.
212

EXIT STATUS

214       llvm-nm exits with an exit code of zero.
215

SEE ALSO

217       llvm-ar(1), llvm-objdump(1), llvm-readelf(1), llvm-readobj(1)
218

AUTHOR

220       Maintained by the LLVM Team (https://llvm.org/).
221
223       2003-2022, LLVM Project
224
225
226
227
22813                                2022-02-02                        LLVM-NM(1)
Impressum