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