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