Update list of passes and buglist.
[oota-llvm.git] / docs / CommandGuide / llvm-nm.html
1 <html>
2 <title>
3 LLVM: llvm-nm tool
4 </title>
5
6 <body bgcolor=white>
7
8 <center><h1>LLVM: <tt>llvm-nm</tt> tool</h1></center>
9 <HR>
10
11 <h3>NAME</h3>
12 <tt>llvm-nm</tt>
13
14 <h3>SYNOPSIS</h3>
15 <tt>llvm-nm [options] [filenames...]</tt>
16
17 <h3>DESCRIPTION</h3>
18
19 <p>The <tt>llvm-nm</tt> utility lists the names of symbols from the
20 LLVM bytecode files named on the command line, along with some
21 ancillary information about each symbol. If no filename is specified,
22 or - is used as a filename, <tt>llvm-nm</tt> reads its input from standard
23 input.</p>
24
25 <p><tt>llvm-nm</tt>'s default output format is the traditional BSD
26 <tt>nm(1)</tt> output format. Each such output record consists of an
27 (optional) 8-digit hexadecimal address, followed by a type code
28 character, followed by a name, for each symbol. One record is printed
29 per line; fields are separated by spaces. When the address is omitted,
30 it is replaced by 8 spaces.</p>
31
32 <p>Type code characters currently supported, and their meanings, are
33 as follows:</p>
34
35 <table border>
36 <tr><td>U</td><td>Named object is referenced but undefined in this
37               bytecode file</td></tr>
38 <tr><td>C</td><td>Common (multiple defs link together into one
39               def)</td></tr>
40 <tr><td>W</td><td>Weak reference (multiple defs link together into zero or
41               one defs)</td></tr>
42 <tr><td>t</td><td>Local function (text) object</td></tr>
43 <tr><td>T</td><td>Global function (text) object</td></tr>
44 <tr><td>d</td><td>Local data object</td></tr>
45 <tr><td>D</td><td>Global data object</td></tr>
46 <tr><td>?</td><td>Something unrecognizable</td></tr>
47 </table>
48
49 <p>Because LLVM bytecode files typically contain objects that are not
50 considered to have addresses until they are linked into an executable
51 image or dynamically compiled "just-in-time", <tt>llvm-nm</tt> does
52 not print an address for any symbol, even symbols which are defined in
53 the bytecode file.</p>
54
55 <h3>OPTIONS</h3>
56
57 <ul>
58         <li> -P
59         <br>
60         Use POSIX.2 output format. Alias for --format=posix.
61         <p>
62         <li> -B    (default)
63         <br>
64         Use BSD output format. Alias for --format=bsd.
65         <p>
66
67         <li> -help
68         <br>
69         Print a summary of command-line options and their meanings.
70         <p>
71
72         <li> -defined-only
73         <br>
74         Print only symbols defined in this bytecode file (as opposed
75         to symbols which may be referenced by objects in this file,
76         but not defined in this file.)
77         <p>
78
79         <li> -extern-only, -g
80         <br>
81         Print only symbols whose definitions are external; that is,
82         accessible from other bytecode files.
83         <p>
84
85         <li> -undefined-only, -u
86         <br>
87         Print only symbols referenced but not defined in this bytecode
88         file.
89         <p>
90
91         <li> -format=<i>fmt</i>, -f
92         <br>
93         Select an output format; <i>fmt</i> may be sysv, posix, or
94         bsd. The default is bsd.
95         <p>
96 </ul>
97
98 <h3>BUGS</h3>
99
100 <tt>llvm-nm</tt> cannot currently see inside <tt>ar(1)</tt> library
101 archive files, like <tt>nm(1)</tt> can. It cannot demangle C++ mangled
102 names, like GNU <tt>nm(1)</tt> can.
103
104 <h3>EXIT STATUS</h3>
105
106 <tt>llvm-nm</tt> exits with an exit code of zero.
107
108 <h3>SEE ALSO</h3>
109
110 <a href="llvm-dis.html"><tt>llvm-dis</tt></a>,
111 <tt>ar(1)</tt>,
112 <tt>nm(1)</tt>
113
114 <HR>
115 Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
116 </body>
117 </html>
118