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