Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 1 | =pod |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
| 5 | llvm-nm - list LLVM bytecode file's symbol table |
| 6 | |
| 7 | =head1 SYNOPSIS |
| 8 | |
Misha Brukman | c08937a | 2004-07-02 16:06:19 +0000 | [diff] [blame] | 9 | B<llvm-nm> [I<options>] [I<filenames...>] |
Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 10 | |
| 11 | =head1 DESCRIPTION |
| 12 | |
| 13 | The B<llvm-nm> utility lists the names of symbols from the LLVM bytecode files, |
| 14 | or B<ar> archives containing LLVM bytecode files, named on the command line. |
| 15 | Each symbol is listed along with some simple information about its provenance. |
Reid Spencer | 6232c03 | 2007-07-09 06:14:11 +0000 | [diff] [blame^] | 16 | If no file name is specified, or I<-> is used as a file name, B<llvm-nm> will |
Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 17 | process a bytecode file on its standard input stream. |
| 18 | |
| 19 | B<llvm-nm>'s default output format is the traditional BSD B<nm> output format. |
| 20 | Each such output record consists of an (optional) 8-digit hexadecimal address, |
| 21 | followed by a type code character, followed by a name, for each symbol. One |
| 22 | record is printed per line; fields are separated by spaces. When the address is |
| 23 | omitted, it is replaced by 8 spaces. |
| 24 | |
| 25 | Type code characters currently supported, and their meanings, are as follows: |
| 26 | |
| 27 | =over |
| 28 | |
| 29 | =item U |
| 30 | |
| 31 | Named object is referenced but undefined in this bytecode file |
| 32 | |
| 33 | =item C |
| 34 | |
Reid Spencer | 6232c03 | 2007-07-09 06:14:11 +0000 | [diff] [blame^] | 35 | Common (multiple definitions link together into one def) |
Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 36 | |
| 37 | =item W |
| 38 | |
Reid Spencer | 6232c03 | 2007-07-09 06:14:11 +0000 | [diff] [blame^] | 39 | Weak reference (multiple definitions link together into zero or one definitions) |
Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 40 | |
| 41 | =item t |
| 42 | |
| 43 | Local function (text) object |
| 44 | |
| 45 | =item T |
| 46 | |
| 47 | Global function (text) object |
| 48 | |
| 49 | =item d |
| 50 | |
| 51 | Local data object |
| 52 | |
| 53 | =item D |
| 54 | |
| 55 | Global data object |
| 56 | |
| 57 | =item ? |
| 58 | |
| 59 | Something unrecognizable |
| 60 | |
| 61 | =back |
| 62 | |
| 63 | Because LLVM bytecode files typically contain objects that are not considered to |
| 64 | have addresses until they are linked into an executable image or dynamically |
| 65 | compiled "just-in-time", B<llvm-nm> does not print an address for any symbol, |
| 66 | even symbols which are defined in the bytecode file. |
| 67 | |
| 68 | =head1 OPTIONS |
| 69 | |
| 70 | =over |
| 71 | |
| 72 | =item B<-P> |
| 73 | |
| 74 | Use POSIX.2 output format. Alias for B<--format=posix>. |
| 75 | |
| 76 | =item B<-B> (default) |
| 77 | |
| 78 | Use BSD output format. Alias for B<--format=bsd>. |
| 79 | |
| 80 | =item B<--help> |
| 81 | |
| 82 | Print a summary of command-line options and their meanings. |
| 83 | |
| 84 | =item B<--defined-only> |
| 85 | |
| 86 | Print only symbols defined in this bytecode file (as opposed to |
| 87 | symbols which may be referenced by objects in this file, but not |
| 88 | defined in this file.) |
| 89 | |
| 90 | =item B<--extern-only>, B<-g> |
| 91 | |
| 92 | Print only symbols whose definitions are external; that is, accessible |
| 93 | from other bytecode files. |
| 94 | |
| 95 | =item B<--undefined-only>, B<-u> |
| 96 | |
| 97 | Print only symbols referenced but not defined in this bytecode file. |
| 98 | |
| 99 | =item B<--format=>I<fmt>, B<-f> |
| 100 | |
| 101 | Select an output format; I<fmt> may be I<sysv>, I<posix>, or I<bsd>. The |
| 102 | default is I<bsd>. |
| 103 | |
| 104 | =back |
| 105 | |
| 106 | =head1 BUGS |
| 107 | |
| 108 | B<llvm-nm> cannot demangle C++ mangled names, like GNU B<nm> can. |
| 109 | |
| 110 | =head1 EXIT STATUS |
| 111 | |
| 112 | B<llvm-nm> exits with an exit code of zero. |
| 113 | |
| 114 | =head1 SEE ALSO |
| 115 | |
Chris Lattner | 1dcf5e8 | 2006-11-20 18:57:02 +0000 | [diff] [blame] | 116 | L<llvm-dis|llvm-dis>, ar(1), nm(1) |
Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 117 | |
| 118 | =head1 AUTHOR |
| 119 | |
Reid Spencer | cd143fc | 2006-03-14 05:42:07 +0000 | [diff] [blame] | 120 | Maintained by the LLVM Team (L<http://llvm.org>). |
Brian Gaeke | f18c06a | 2004-07-01 19:40:36 +0000 | [diff] [blame] | 121 | |
| 122 | =cut |