blob: 995ac08139ac0c14cb87b6a7085fdde4d6191bb2 [file] [log] [blame]
Brian Gaekef18c06a2004-07-01 19:40:36 +00001=pod
2
3=head1 NAME
4
Gabor Greif3bd6e0d2007-07-09 11:24:05 +00005llvm-nm - list LLVM bitcode file's symbol table
Brian Gaekef18c06a2004-07-01 19:40:36 +00006
7=head1 SYNOPSIS
8
Misha Brukmanc08937a2004-07-02 16:06:19 +00009B<llvm-nm> [I<options>] [I<filenames...>]
Brian Gaekef18c06a2004-07-01 19:40:36 +000010
11=head1 DESCRIPTION
12
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000013The B<llvm-nm> utility lists the names of symbols from the LLVM bitcode files,
14or B<ar> archives containing LLVM bitcode files, named on the command line.
Brian Gaekef18c06a2004-07-01 19:40:36 +000015Each symbol is listed along with some simple information about its provenance.
Reid Spencer6232c032007-07-09 06:14:11 +000016If no file name is specified, or I<-> is used as a file name, B<llvm-nm> will
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000017process a bitcode file on its standard input stream.
Brian Gaekef18c06a2004-07-01 19:40:36 +000018
19B<llvm-nm>'s default output format is the traditional BSD B<nm> output format.
20Each such output record consists of an (optional) 8-digit hexadecimal address,
21followed by a type code character, followed by a name, for each symbol. One
22record is printed per line; fields are separated by spaces. When the address is
23omitted, it is replaced by 8 spaces.
24
25Type code characters currently supported, and their meanings, are as follows:
26
27=over
28
29=item U
30
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000031Named object is referenced but undefined in this bitcode file
Brian Gaekef18c06a2004-07-01 19:40:36 +000032
33=item C
34
Reid Spencer6232c032007-07-09 06:14:11 +000035Common (multiple definitions link together into one def)
Brian Gaekef18c06a2004-07-01 19:40:36 +000036
37=item W
38
Reid Spencer6232c032007-07-09 06:14:11 +000039Weak reference (multiple definitions link together into zero or one definitions)
Brian Gaekef18c06a2004-07-01 19:40:36 +000040
41=item t
42
43Local function (text) object
44
45=item T
46
47Global function (text) object
48
49=item d
50
51Local data object
52
53=item D
54
55Global data object
56
57=item ?
58
59Something unrecognizable
60
61=back
62
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000063Because LLVM bitcode files typically contain objects that are not considered to
Brian Gaekef18c06a2004-07-01 19:40:36 +000064have addresses until they are linked into an executable image or dynamically
65compiled "just-in-time", B<llvm-nm> does not print an address for any symbol,
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000066even symbols which are defined in the bitcode file.
Brian Gaekef18c06a2004-07-01 19:40:36 +000067
68=head1 OPTIONS
69
70=over
71
72=item B<-P>
73
74Use POSIX.2 output format. Alias for B<--format=posix>.
75
76=item B<-B> (default)
77
78Use BSD output format. Alias for B<--format=bsd>.
79
80=item B<--help>
81
82Print a summary of command-line options and their meanings.
83
84=item B<--defined-only>
85
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000086Print only symbols defined in this bitcode file (as opposed to
Brian Gaekef18c06a2004-07-01 19:40:36 +000087symbols which may be referenced by objects in this file, but not
88defined in this file.)
89
90=item B<--extern-only>, B<-g>
91
92Print only symbols whose definitions are external; that is, accessible
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000093from other bitcode files.
Brian Gaekef18c06a2004-07-01 19:40:36 +000094
95=item B<--undefined-only>, B<-u>
96
Gabor Greif3bd6e0d2007-07-09 11:24:05 +000097Print only symbols referenced but not defined in this bitcode file.
Brian Gaekef18c06a2004-07-01 19:40:36 +000098
99=item B<--format=>I<fmt>, B<-f>
100
101Select an output format; I<fmt> may be I<sysv>, I<posix>, or I<bsd>. The
102default is I<bsd>.
103
104=back
105
106=head1 BUGS
107
108B<llvm-nm> cannot demangle C++ mangled names, like GNU B<nm> can.
109
110=head1 EXIT STATUS
111
112B<llvm-nm> exits with an exit code of zero.
113
114=head1 SEE ALSO
115
Chris Lattner1dcf5e82006-11-20 18:57:02 +0000116L<llvm-dis|llvm-dis>, ar(1), nm(1)
Brian Gaekef18c06a2004-07-01 19:40:36 +0000117
118=head1 AUTHOR
119
Reid Spencercd143fc2006-03-14 05:42:07 +0000120Maintained by the LLVM Team (L<http://llvm.org>).
Brian Gaekef18c06a2004-07-01 19:40:36 +0000121
122=cut