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