Modified the linker so that it always links in an object from an archive
[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, or <tt>ar(1)</tt> archives containing LLVM
21 bytecode files, named on the command line. Each symbol is listed along
22 with some simple information about its provenance. If no filename is specified,
23 or - is used as a filename, <tt>llvm-nm</tt> will process a bytecode file
24 on its standard input stream.</p>
25
26 <p><tt>llvm-nm</tt>'s default output format is the traditional BSD
27 <tt>nm(1)</tt> output format. Each such output record consists of an
28 (optional) 8-digit hexadecimal address, followed by a type code
29 character, followed by a name, for each symbol. One record is printed
30 per line; fields are separated by spaces. When the address is omitted,
31 it is replaced by 8 spaces.</p>
32
33 <p>Type code characters currently supported, and their meanings, are
34 as follows:</p>
35
36 <table border>
37 <tr><td>U</td><td>Named object is referenced but undefined in this
38               bytecode file</td></tr>
39 <tr><td>C</td><td>Common (multiple defs link together into one
40               def)</td></tr>
41 <tr><td>W</td><td>Weak reference (multiple defs link together into zero or
42               one defs)</td></tr>
43 <tr><td>t</td><td>Local function (text) object</td></tr>
44 <tr><td>T</td><td>Global function (text) object</td></tr>
45 <tr><td>d</td><td>Local data object</td></tr>
46 <tr><td>D</td><td>Global data object</td></tr>
47 <tr><td>?</td><td>Something unrecognizable</td></tr>
48 </table>
49
50 <p>Because LLVM bytecode files typically contain objects that are not
51 considered to have addresses until they are linked into an executable
52 image or dynamically compiled "just-in-time", <tt>llvm-nm</tt> does
53 not print an address for any symbol, even symbols which are defined in
54 the bytecode file.</p>
55
56 <h3>OPTIONS</h3>
57
58 <ul>
59         <li> -P
60         <br>
61         Use POSIX.2 output format. Alias for --format=posix.
62         <p>
63         <li> -B    (default)
64         <br>
65         Use BSD output format. Alias for --format=bsd.
66         <p>
67
68         <li> -help
69         <br>
70         Print a summary of command-line options and their meanings.
71         <p>
72
73         <li> -defined-only
74         <br>
75         Print only symbols defined in this bytecode file (as opposed
76         to symbols which may be referenced by objects in this file,
77         but not defined in this file.)
78         <p>
79
80         <li> -extern-only, -g
81         <br>
82         Print only symbols whose definitions are external; that is,
83         accessible from other bytecode files.
84         <p>
85
86         <li> -undefined-only, -u
87         <br>
88         Print only symbols referenced but not defined in this bytecode
89         file.
90         <p>
91
92         <li> -format=<i>fmt</i>, -f
93         <br>
94         Select an output format; <i>fmt</i> may be sysv, posix, or
95         bsd. The default is bsd.
96         <p>
97 </ul>
98
99 <h3>BUGS</h3>
100
101 <tt>llvm-nm</tt> 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