328 lines · plain
1llvm-nm - list LLVM bitcode and object file's symbol table2==========================================================3 4.. program:: llvm-nm5 6SYNOPSIS7--------8 9:program:`llvm-nm` [*options*] [*filenames...*]10 11DESCRIPTION12-----------13 14The :program:`llvm-nm` utility lists the names of symbols from LLVM bitcode15files, object files, and archives. Each symbol is listed along with some simple16information about its provenance. If no filename is specified, *a.out* is used17as the input. If *-* is used as a filename, :program:`llvm-nm` will read a file18from its standard input stream.19 20:program:`llvm-nm`'s default output format is the traditional BSD :program:`nm`21output format. Each such output record consists of an (optional) 8-digit22hexadecimal address, followed by a type code character, followed by a name, for23each symbol. One record is printed per line; fields are separated by spaces.24When the address is omitted, it is replaced by 8 spaces.25 26The supported type code characters are as follows. Where both lower and27upper-case characters are listed for the same meaning, a lower-case character28represents a local symbol, whilst an upper-case character represents a global29(external) symbol:30 31a, A32 33 Absolute symbol.34 35b, B36 37 Uninitialized data (bss) object.38 39C40 41 Common symbol. Multiple definitions link together into one definition.42 43d, D44 45 Writable data object.46 47i, I48 49 COFF: .idata symbol or symbol in a section with IMAGE_SCN_LNK_INFO set.50 51n52 53 ELF: local symbol from non-alloc section.54 55 COFF: debug symbol.56 57N58 59 ELF: debug section symbol, or global symbol from non-alloc section.60 61s, S62 63 COFF: section symbol.64 65 Mach-O: absolute symbol or symbol from a section other than __TEXT_EXEC __text,66 __TEXT __text, __DATA __data, or __DATA __bss.67 68r, R69 70 Read-only data object.71 72t, T73 74 Code (text) object.75 76u77 78 ELF: GNU unique symbol.79 80U81 82 Named object is undefined in this file.83 84v85 86 ELF: Undefined weak object. It is not a link failure if the object is not87 defined.88 89V90 91 ELF: Defined weak object symbol. This definition will only be used if no92 regular definitions exist in a link. If multiple weak definitions and no93 regular definitions exist, one of the weak definitions will be used.94 95w96 97 Undefined weak symbol other than an ELF object symbol. It is not a link failure98 if the symbol is not defined.99 100W101 102 Defined weak symbol other than an ELF object symbol. This definition will only103 be used if no regular definitions exist in a link. If multiple weak definitions104 and no regular definitions exist, one of the weak definitions will be used.105 106\-107 108 Mach-O: N_STAB symbol.109 110?111 112 Something unrecognizable.113 114Because LLVM bitcode files typically contain objects that are not considered to115have addresses until they are linked into an executable image or dynamically116compiled "just-in-time", :program:`llvm-nm` does not print an address for any117symbol in an LLVM bitcode file, even symbols which are defined in the bitcode118file.119 120OPTIONS121-------122 123.. program:: llvm-nm124 125.. option:: -B126 127 Use BSD output format. Alias for ``--format=bsd``.128 129.. option:: -X130 131 Specify the type of XCOFF object file, ELF object file, or IR object file input132 from command line or from archive files that llvm-nm should examine. The133 mode must be one of the following:134 135 32136 Process only 32-bit object files.137 64138 Process only 64-bit object files.139 32_64140 Process both 32-bit and 64-bit object files.141 any142 Process all the supported object files.143 144 On AIX OS, the default is to process 32-bit object files only and to ignore145 64-bit objects. The can be changed by setting the OBJECT_MODE environment146 variable. For example, OBJECT_MODE=64 causes :program:`llvm-nm` to process147 64-bit objects and ignore 32-bit objects. The -X flag overrides the OBJECT_MODE148 variable.149 150 On other operating systems, the default is to process all object files: the151 OBJECT_MODE environment variable is not supported.152 153.. option:: --debug-syms, -a154 155 Show all symbols, even those usually suppressed.156 157.. option:: --defined-only, -U158 159 Print only symbols defined in this file.160 161.. option:: --demangle, -C162 163 Demangle symbol names.164 165.. option:: --dynamic, -D166 167 Display dynamic symbols instead of normal symbols.168 169.. option:: --export-symbols170 171 Print sorted symbols with their visibility (if applicable), with duplicates172 removed.173 174.. option:: --extern-only, -g175 176 Print only symbols whose definitions are external; that is, accessible from177 other files.178 179.. option:: --format=<format>, -f180 181 Select an output format; *format* may be *sysv*, *posix*, *darwin*, *bsd* or182 *just-symbols*.183 The default is *bsd*.184 185.. option:: --help, -h186 187 Print a summary of command-line options and their meanings.188 189.. option:: -j190 191 Print just the symbol names. Alias for `--format=just-symbols``.192 193.. option:: --line-numbers, -l194 195 Use debugging information to print the filenames and line numbers where196 symbols are defined. Undefined symbols have the location of their first197 relocation printed instead.198 199.. option:: -m200 201 Use Darwin format. Alias for ``--format=darwin``.202 203.. option:: --no-demangle204 205 Don't demangle symbol names. This is the default.206 207.. option:: --no-llvm-bc208 209 Disable the LLVM bitcode reader.210 211.. option:: --no-sort, -p212 213 Show symbols in the order encountered.214 215.. option:: --no-weak, -W216 217 Don't print weak symbols.218 219.. option:: --numeric-sort, -n, -v220 221 Sort symbols by address.222 223.. option:: --portability, -P224 225 Use POSIX.2 output format. Alias for ``--format=posix``.226 227.. option:: --print-armap228 229 Print the archive symbol table, in addition to the symbols.230 231.. option:: --print-file-name, -A, -o232 233 Precede each symbol with the file it came from.234 235.. option:: --print-size, -S236 237 Show symbol size as well as address (not applicable for Mach-O).238 239.. option:: --quiet240 241 Suppress 'no symbols' diagnostic.242 243.. option:: --radix=<RADIX>, -t244 245 Specify the radix of the symbol address(es). Values accepted are *d* (decimal),246 *x* (hexadecimal) and *o* (octal).247 248.. option:: --reverse-sort, -r249 250 Sort symbols in reverse order.251 252.. option:: --size-sort253 254 Sort symbols by size.255 256.. option:: --special-syms257 258 Do not filter special symbols from the output.259 260.. option:: --undefined-only, -u261 262 Print only undefined symbols.263 264.. option:: --version, -V265 266 Display the version of the :program:`llvm-nm` executable, then exit. Does not267 stack with other commands.268 269.. option:: @<FILE>270 271 Read command-line options from response file `<FILE>`.272 273MACH-O SPECIFIC OPTIONS274-----------------------275 276.. option:: --add-dyldinfo277 278 Add symbols from the dyldinfo, if they are not already in the symbol table.279 This is the default.280 281.. option:: --add-inlinedinfo282 283 Add symbols from the inlined libraries, TBD file inputs only.284 285.. option:: --arch=<arch1[,arch2,...]>286 287 Dump the symbols from the specified architecture(s).288 289.. option:: --dyldinfo-only290 291 Dump only symbols from the dyldinfo.292 293.. option:: --no-dyldinfo294 295 Do not add any symbols from the dyldinfo.296 297.. option:: -s <segment> <section>298 299 Dump only symbols from this segment and section name.300 301.. option:: -x302 303 Print symbol entry in hex.304 305XCOFF SPECIFIC OPTIONS306----------------------307 308.. option:: --no-rsrc309 310 Exclude resource file symbols (``__rsrc``) from export symbol list.311 312BUGS313----314 315 * :program:`llvm-nm` does not support the full set of arguments that GNU316 :program:`nm` does.317 318EXIT STATUS319-----------320 321:program:`llvm-nm` exits with an exit code of zero.322 323SEE ALSO324--------325 326:manpage:`llvm-ar(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`,327:manpage:`llvm-readobj(1)`328