Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 1 | llvm-objdump - LLVM's object file dumper |
| 2 | ======================================== |
| 3 | |
James Henderson | a056684 | 2019-06-27 13:24:46 +0000 | [diff] [blame] | 4 | .. program:: llvm-objdump |
| 5 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 6 | SYNOPSIS |
| 7 | -------- |
| 8 | |
| 9 | :program:`llvm-objdump` [*commands*] [*options*] [*filenames...*] |
| 10 | |
| 11 | DESCRIPTION |
| 12 | ----------- |
| 13 | The :program:`llvm-objdump` utility prints the contents of object files and |
| 14 | final linked images named on the command line. If no file name is specified, |
| 15 | :program:`llvm-objdump` will attempt to read from *a.out*. If *-* is used as a |
| 16 | file name, :program:`llvm-objdump` will process a file on its standard input |
| 17 | stream. |
| 18 | |
| 19 | COMMANDS |
| 20 | -------- |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 21 | At least one of the following commands are required, and some commands can be |
| 22 | combined with other commands: |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 23 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 24 | .. option:: -a, --archive-headers |
| 25 | |
| 26 | Display the information contained within an archive's headers. |
| 27 | |
| 28 | .. option:: -d, --disassemble |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 29 | |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 30 | Display assembler mnemonics for the machine instructions. Disassembles all |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 31 | text sections found in the input file(s) by default. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 32 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 33 | .. option:: -D, --disassemble-all |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 34 | |
| 35 | Display assembler mnemonics for the machine instructions. Disassembles all |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 36 | sections found in the input file(s) by default. |
| 37 | |
Yuanfang Chen | 2dcd2c2 | 2019-06-27 18:39:34 +0000 | [diff] [blame] | 38 | .. option:: --disassemble-functions=<symbol1[,symbol2,...]> |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 39 | |
Yuanfang Chen | 2dcd2c2 | 2019-06-27 18:39:34 +0000 | [diff] [blame] | 40 | Disassemble only the specified symbols. Takes demangled symbol names when |
| 41 | :option:`--demangle` is specified, otherwise takes mangled symbol names. |
| 42 | Implies :option:`--disassemble`. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 43 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 44 | .. option:: --dwarf=<value> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 45 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 46 | Dump the specified DWARF debug sections. The supported values are: |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 47 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 48 | `frames` - .debug_frame |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 49 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 50 | .. option:: -f, --file-headers |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 51 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 52 | Display the contents of the overall file header. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 53 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 54 | .. option:: --fault-map-section |
| 55 | |
| 56 | Display the content of the fault map section. |
| 57 | |
| 58 | .. option:: -h, --headers, --section-headers |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 59 | |
| 60 | Display summaries of the headers for each section. |
| 61 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 62 | .. option:: --help |
| 63 | |
| 64 | Display usage information and exit. Does not stack with other commands. |
| 65 | |
| 66 | .. option:: -p, --private-headers |
| 67 | |
| 68 | Display format-specific file headers. |
| 69 | |
| 70 | .. option:: -r, --reloc |
| 71 | |
| 72 | Display the relocation entries in the file. |
| 73 | |
| 74 | .. option:: -R, --dynamic-reloc |
| 75 | |
| 76 | Display the dynamic relocation entries in the file. |
| 77 | |
| 78 | .. option:: --raw-clang-ast |
| 79 | |
| 80 | Dump the raw binary contents of the clang AST section. |
| 81 | |
| 82 | .. option:: -s, --full-contents |
| 83 | |
| 84 | Display the contents of each section. |
| 85 | |
| 86 | .. option:: -t, --syms |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 87 | |
| 88 | Display the symbol table. |
| 89 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 90 | .. option:: -u, --unwind-info |
| 91 | |
| 92 | Display the unwind info of the input(s). |
| 93 | |
| 94 | .. option:: --version |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 95 | |
| 96 | Display the version of this program. Does not stack with other commands. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 97 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 98 | .. option:: -x, --all-headers |
| 99 | |
| 100 | Display all available header information. Equivalent to specifying |
| 101 | :option:`--archive-headers`, :option:`--file-headers`, |
| 102 | :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`, |
| 103 | and :option:`--syms`. |
| 104 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 105 | OPTIONS |
| 106 | ------- |
| 107 | :program:`llvm-objdump` supports the following options: |
| 108 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 109 | .. option:: --adjust-vma=<offset> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 110 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 111 | Increase the displayed address in disassembly or section header printing by |
| 112 | the specified offset. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 113 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 114 | .. option:: --arch-name=<string> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 115 | |
Yuanfang Chen | 2dcd2c2 | 2019-06-27 18:39:34 +0000 | [diff] [blame] | 116 | Specify the target architecture when disassembling. Use :option:`--version` |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 117 | for a list of available targets. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 118 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 119 | .. option:: -C, --demangle |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 120 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 121 | Demangle symbol names in the output. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 122 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 123 | .. option:: -j, --section=<section1[,section2,...]> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 124 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 125 | Perform the specified command(s) on the specified section(s) only. For Mach-O |
| 126 | use `segment,section` to specify the section name. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 127 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 128 | .. option:: -l, --line-numbers |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 129 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 130 | When disassembling, display source line numbers with disassembly. Implies |
| 131 | :option:`--disassemble`. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 132 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 133 | .. option:: -M, --disassembler-options=<opt1[,opt2,...]> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 134 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 135 | Pass target-specific disassembler options. Currently supported for ARM targets |
| 136 | only. Available options are ``reg-names-std`` and ``reg-names-raw``. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 137 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 138 | .. option:: --mcpu=<cpu-name> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 139 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 140 | Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display |
| 141 | available CPUs. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 142 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 143 | .. option:: --mattr=<a1,+a2,-a3,...> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 144 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 145 | Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display |
| 146 | the available attributes. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 147 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 148 | .. option:: --no-leading-addr |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 149 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 150 | When disassembling, do not print the leading address in the disassembly |
| 151 | output. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 152 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 153 | .. option:: --no-show-raw-insn |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 154 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 155 | When disassembling instructions, do not print the raw bytes of the |
| 156 | instruction. |
| 157 | |
| 158 | .. option:: --print-imm-hex |
| 159 | |
| 160 | Use hex format when printing immediate values in disassembly output. |
| 161 | |
| 162 | .. option:: -S, --source |
| 163 | |
| 164 | When disassembling, display source inlined with the disassembly. |
| 165 | Implies :option:`--disassemble`. |
| 166 | |
| 167 | .. option:: --show-lma |
| 168 | |
| 169 | Display the LMA column when dumping ELF section headers. Defaults to off |
| 170 | unless any section has different VMA and LMAs. |
| 171 | |
| 172 | .. option:: --start-address=<address> |
| 173 | |
| 174 | When disassembling, only disassemble from the specified address. |
| 175 | |
| 176 | When printing relocations, only print the relocations patching offsets from at least ``address``. |
| 177 | |
| 178 | When printing symbols, only print symbols with a value of at least ``address``. |
| 179 | |
| 180 | .. option:: --stop-address=<address> |
| 181 | |
| 182 | When disassembling, only disassemble up to, but not including the specified address. |
| 183 | |
| 184 | When printing relocations, only print the relocations patching offsets up to ``address``. |
| 185 | |
| 186 | When printing symbols, only print symbols with a value up to ``address``. |
| 187 | |
| 188 | .. option:: --triple=<string> |
| 189 | |
| 190 | Target triple to disassemble for, see ``--version`` for available targets. |
| 191 | |
| 192 | .. option:: -w, --wide |
| 193 | |
| 194 | Ignored for compatibility with GNU objdump. |
| 195 | |
| 196 | .. option:: --x86-asm-syntax=<style> |
| 197 | |
Yuanfang Chen | 2dcd2c2 | 2019-06-27 18:39:34 +0000 | [diff] [blame] | 198 | When used with :option:`--disassemble`, choose style of code to emit from |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 199 | X86 backend. Supported values are: |
| 200 | |
| 201 | .. option:: att |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 202 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 203 | AT&T-style assembly |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 204 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 205 | .. option:: intel |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 206 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 207 | Intel-style assembly |
| 208 | |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 209 | |
| 210 | The default disassembly style is **att**. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 211 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 212 | .. option:: -z, --disassemble-zeroes |
| 213 | |
| 214 | Do not skip blocks of zeroes when disassembling. |
| 215 | |
James Henderson | f7212db | 2019-06-21 14:41:36 +0000 | [diff] [blame] | 216 | .. option:: @<FILE> |
| 217 | |
| 218 | Read command-line options and commands from response file `<FILE>`. |
| 219 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 220 | MACH-O ONLY OPTIONS AND COMMANDS |
| 221 | -------------------------------- |
| 222 | |
| 223 | .. option:: --arch=<architecture> |
| 224 | |
| 225 | Specify the architecture to disassemble. see ``--version`` for available |
| 226 | architectures. |
| 227 | |
| 228 | .. option:: --archive-member-offsets |
| 229 | |
| 230 | Print the offset to each archive member for Mach-O archives (requires |
| 231 | :option:`--archive-headers`). |
| 232 | |
| 233 | .. option:: --bind |
| 234 | |
| 235 | Display binding info |
| 236 | |
| 237 | .. option:: --cfg |
| 238 | |
| 239 | Create a CFG for every symbol in the object file and write it to a graphviz |
| 240 | file. |
| 241 | |
| 242 | .. option:: --data-in-code |
| 243 | |
| 244 | Display the data in code table. |
| 245 | |
| 246 | .. option:: --dis-symname=<name> |
| 247 | |
| 248 | Disassemble just the specified symbol's instructions. |
| 249 | |
| 250 | .. option:: --dylibs-used |
| 251 | |
| 252 | Display the shared libraries used for linked files. |
| 253 | |
| 254 | .. option:: --dsym=<string> |
| 255 | |
| 256 | Use .dSYM file for debug info. |
| 257 | |
| 258 | .. option:: --dylib-id |
| 259 | |
| 260 | Display the shared library's ID for dylib files. |
| 261 | |
| 262 | .. option:: --exports-trie |
| 263 | |
| 264 | Display exported symbols. |
| 265 | |
| 266 | .. option:: -g |
| 267 | |
| 268 | Print line information from debug info if available. |
| 269 | |
| 270 | .. option:: --full-leading-addr |
| 271 | |
| 272 | Print the full leading address when disassembling. |
| 273 | |
| 274 | .. option:: --indirect-symbols |
| 275 | |
| 276 | Display the indirect symbol table. |
| 277 | |
| 278 | .. option:: --info-plist |
| 279 | |
| 280 | Display the info plist section as strings. |
| 281 | |
| 282 | .. option:: --lazy-bind |
| 283 | |
| 284 | Display lazy binding info. |
| 285 | |
| 286 | .. option:: --link-opt-hints |
| 287 | |
| 288 | Display the linker optimization hints. |
| 289 | |
| 290 | .. option:: -m, --macho |
| 291 | |
| 292 | Use Mach-O specific object file parser. Commands and other options may behave |
| 293 | differently when used with ``--macho``. |
| 294 | |
| 295 | .. option:: --no-leading-headers |
| 296 | |
| 297 | Do not print any leading headers. |
| 298 | |
| 299 | .. option:: --no-symbolic-operands |
| 300 | |
| 301 | Do not print symbolic operands when disassembling. |
| 302 | |
| 303 | .. option:: --non-verbose |
| 304 | |
| 305 | Display the information for Mach-O objects in non-verbose or numeric form. |
| 306 | |
| 307 | .. option:: --objc-meta-data |
| 308 | |
| 309 | Display the Objective-C runtime meta data. |
| 310 | |
| 311 | .. option:: --private-header |
| 312 | |
| 313 | Display only the first format specific file header. |
| 314 | |
| 315 | .. option:: --rebase |
| 316 | |
| 317 | Display rebasing information. |
| 318 | |
| 319 | .. option:: --universal-headers |
| 320 | |
| 321 | Display universal headers. |
| 322 | |
| 323 | .. option:: --weak-bind |
| 324 | |
| 325 | Display weak binding information. |
| 326 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 327 | BUGS |
| 328 | ---- |
| 329 | |
| 330 | To report bugs, please visit <http://llvm.org/bugs/>. |
| 331 | |
| 332 | SEE ALSO |
| 333 | -------- |
| 334 | |
James Henderson | 92b32a9 | 2019-06-27 15:18:15 +0000 | [diff] [blame] | 335 | :manpage:`llvm-nm(1)`, :manpage:`llvm-readelf(1)`, :manpage:`llvm-readobj(1)` |