blob: 1ada009dbfc65d67d5429004b972650c4649c850 [file] [log] [blame]
Daniel Dunbar3b709d52012-05-08 16:50:35 +00001llvm-nm - list LLVM bitcode file's symbol table
2===============================================
3
4
5SYNOPSIS
6--------
7
8
9**llvm-nm** [*options*] [*filenames...*]
10
11
12DESCRIPTION
13-----------
14
15
16The **llvm-nm** utility lists the names of symbols from the LLVM bitcode files,
17or **ar** archives containing LLVM bitcode files, named on the command line.
18Each symbol is listed along with some simple information about its provenance.
19If no file name is specified, or *-* is used as a file name, **llvm-nm** will
20process a bitcode file on its standard input stream.
21
22**llvm-nm**'s default output format is the traditional BSD **nm** output format.
23Each such output record consists of an (optional) 8-digit hexadecimal address,
24followed by a type code character, followed by a name, for each symbol. One
25record is printed per line; fields are separated by spaces. When the address is
26omitted, it is replaced by 8 spaces.
27
28Type code characters currently supported, and their meanings, are as follows:
29
30
31U
32
33 Named object is referenced but undefined in this bitcode file
34
35
36
37C
38
39 Common (multiple definitions link together into one def)
40
41
42
43W
44
45 Weak reference (multiple definitions link together into zero or one definitions)
46
47
48
49t
50
51 Local function (text) object
52
53
54
55T
56
57 Global function (text) object
58
59
60
61d
62
63 Local data object
64
65
66
67D
68
69 Global data object
70
71
72
73?
74
75 Something unrecognizable
76
77
78
79Because LLVM bitcode files typically contain objects that are not considered to
80have addresses until they are linked into an executable image or dynamically
81compiled "just-in-time", **llvm-nm** does not print an address for any symbol,
82even symbols which are defined in the bitcode file.
83
84
85OPTIONS
86-------
87
88
89
90**-P**
91
92 Use POSIX.2 output format. Alias for **--format=posix**.
93
94
95
96**-B** (default)
97
98 Use BSD output format. Alias for **--format=bsd**.
99
100
101
102**-help**
103
104 Print a summary of command-line options and their meanings.
105
106
107
108**--defined-only**
109
110 Print only symbols defined in this bitcode file (as opposed to
111 symbols which may be referenced by objects in this file, but not
112 defined in this file.)
113
114
115
116**--extern-only**, **-g**
117
118 Print only symbols whose definitions are external; that is, accessible
119 from other bitcode files.
120
121
122
123**--undefined-only**, **-u**
124
125 Print only symbols referenced but not defined in this bitcode file.
126
127
128
129
130 Select an output format; *fmt* may be *sysv*, *posix*, or *bsd*. The
131 default is *bsd*.
132
133
134
135
136BUGS
137----
138
139
140**llvm-nm** cannot demangle C++ mangled names, like GNU **nm** can.
141
142
143EXIT STATUS
144-----------
145
146
147**llvm-nm** exits with an exit code of zero.
148
149
150SEE ALSO
151--------
152
153
154llvm-dis|llvm-dis, ar(1), nm(1)