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 | |
| 38 | .. option:: --disassemble-functions=<func1[,func2,...]> |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 39 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 40 | Disassemble only the specified symbols. 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 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 88 | .. option:: -u, --unwind-info |
| 89 | |
| 90 | Display the unwind info of the input(s). |
| 91 | |
| 92 | .. option:: --version |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 93 | |
| 94 | Display the version of this program. Does not stack with other commands. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 95 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 96 | .. option:: -x, --all-headers |
| 97 | |
| 98 | Display all available header information. Equivalent to specifying |
| 99 | :option:`--archive-headers`, :option:`--file-headers`, |
| 100 | :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`, |
| 101 | and :option:`--syms`. |
| 102 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 103 | OPTIONS |
| 104 | ------- |
| 105 | :program:`llvm-objdump` supports the following options: |
| 106 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 107 | .. option:: --adjust-vma=<offset> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 108 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 109 | Increase the displayed address in disassembly or section header printing by |
| 110 | the specified offset. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 111 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 112 | .. option:: --arch-name=<string> |
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 | Specify the target architecture when disassembling. Use :option:``--version`` |
| 115 | for a list of available targets. |
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:: -C, --demangle |
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 | Demangle symbol names in the output. |
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 | .. option:: -j, --section=<section1[,section2,...]> |
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 | Perform the specified command(s) on the specified section(s) only. For Mach-O |
| 124 | use `segment,section` to specify the section name. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 125 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 126 | .. option:: -l, --line-numbers |
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 | When disassembling, display source line numbers with disassembly. Implies |
| 129 | :option:`--disassemble`. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 130 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 131 | .. option:: -M, --disassembler-options=<opt1[,opt2,...]> |
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 | Pass target-specific disassembler options. Currently supported for ARM targets |
| 134 | only. Available options are ``reg-names-std`` and ``reg-names-raw``. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 135 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 136 | .. option:: --mcpu=<cpu-name> |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 137 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 138 | Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display |
| 139 | available CPUs. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 140 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 141 | .. option:: --mattr=<a1,+a2,-a3,...> |
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 | Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display |
| 144 | the available attributes. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 145 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 146 | .. option:: --no-leading-addr |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 147 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 148 | When disassembling, do not print the leading address in the disassembly |
| 149 | output. |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 150 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 151 | .. option:: --no-show-raw-insn |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 152 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 153 | When disassembling instructions, do not print the raw bytes of the |
| 154 | instruction. |
| 155 | |
| 156 | .. option:: --print-imm-hex |
| 157 | |
| 158 | Use hex format when printing immediate values in disassembly output. |
| 159 | |
| 160 | .. option:: -S, --source |
| 161 | |
| 162 | When disassembling, display source inlined with the disassembly. |
| 163 | Implies :option:`--disassemble`. |
| 164 | |
| 165 | .. option:: --show-lma |
| 166 | |
| 167 | Display the LMA column when dumping ELF section headers. Defaults to off |
| 168 | unless any section has different VMA and LMAs. |
| 169 | |
| 170 | .. option:: --start-address=<address> |
| 171 | |
| 172 | When disassembling, only disassemble from the specified address. |
| 173 | |
| 174 | When printing relocations, only print the relocations patching offsets from at least ``address``. |
| 175 | |
| 176 | When printing symbols, only print symbols with a value of at least ``address``. |
| 177 | |
| 178 | .. option:: --stop-address=<address> |
| 179 | |
| 180 | When disassembling, only disassemble up to, but not including the specified address. |
| 181 | |
| 182 | When printing relocations, only print the relocations patching offsets up to ``address``. |
| 183 | |
| 184 | When printing symbols, only print symbols with a value up to ``address``. |
| 185 | |
| 186 | .. option:: --triple=<string> |
| 187 | |
| 188 | Target triple to disassemble for, see ``--version`` for available targets. |
| 189 | |
| 190 | .. option:: -w, --wide |
| 191 | |
| 192 | Ignored for compatibility with GNU objdump. |
| 193 | |
| 194 | .. option:: --x86-asm-syntax=<style> |
| 195 | |
| 196 | When used with the ``--disassemble`` option, choose style of code to emit from |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 197 | X86 backend. Supported values are: |
| 198 | |
| 199 | .. option:: att |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 200 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 201 | AT&T-style assembly |
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 | .. option:: intel |
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 | Intel-style assembly |
| 206 | |
Michael Trent | 7e66021 | 2019-01-15 20:41:30 +0000 | [diff] [blame] | 207 | |
| 208 | The default disassembly style is **att**. |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 209 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 210 | .. option:: -z, --disassemble-zeroes |
| 211 | |
| 212 | Do not skip blocks of zeroes when disassembling. |
| 213 | |
James Henderson | f7212db | 2019-06-21 14:41:36 +0000 | [diff] [blame] | 214 | .. option:: @<FILE> |
| 215 | |
| 216 | Read command-line options and commands from response file `<FILE>`. |
| 217 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 218 | MACH-O ONLY OPTIONS AND COMMANDS |
| 219 | -------------------------------- |
| 220 | |
| 221 | .. option:: --arch=<architecture> |
| 222 | |
| 223 | Specify the architecture to disassemble. see ``--version`` for available |
| 224 | architectures. |
| 225 | |
| 226 | .. option:: --archive-member-offsets |
| 227 | |
| 228 | Print the offset to each archive member for Mach-O archives (requires |
| 229 | :option:`--archive-headers`). |
| 230 | |
| 231 | .. option:: --bind |
| 232 | |
| 233 | Display binding info |
| 234 | |
| 235 | .. option:: --cfg |
| 236 | |
| 237 | Create a CFG for every symbol in the object file and write it to a graphviz |
| 238 | file. |
| 239 | |
| 240 | .. option:: --data-in-code |
| 241 | |
| 242 | Display the data in code table. |
| 243 | |
| 244 | .. option:: --dis-symname=<name> |
| 245 | |
| 246 | Disassemble just the specified symbol's instructions. |
| 247 | |
| 248 | .. option:: --dylibs-used |
| 249 | |
| 250 | Display the shared libraries used for linked files. |
| 251 | |
| 252 | .. option:: --dsym=<string> |
| 253 | |
| 254 | Use .dSYM file for debug info. |
| 255 | |
| 256 | .. option:: --dylib-id |
| 257 | |
| 258 | Display the shared library's ID for dylib files. |
| 259 | |
| 260 | .. option:: --exports-trie |
| 261 | |
| 262 | Display exported symbols. |
| 263 | |
| 264 | .. option:: -g |
| 265 | |
| 266 | Print line information from debug info if available. |
| 267 | |
| 268 | .. option:: --full-leading-addr |
| 269 | |
| 270 | Print the full leading address when disassembling. |
| 271 | |
| 272 | .. option:: --indirect-symbols |
| 273 | |
| 274 | Display the indirect symbol table. |
| 275 | |
| 276 | .. option:: --info-plist |
| 277 | |
| 278 | Display the info plist section as strings. |
| 279 | |
| 280 | .. option:: --lazy-bind |
| 281 | |
| 282 | Display lazy binding info. |
| 283 | |
| 284 | .. option:: --link-opt-hints |
| 285 | |
| 286 | Display the linker optimization hints. |
| 287 | |
| 288 | .. option:: -m, --macho |
| 289 | |
| 290 | Use Mach-O specific object file parser. Commands and other options may behave |
| 291 | differently when used with ``--macho``. |
| 292 | |
| 293 | .. option:: --no-leading-headers |
| 294 | |
| 295 | Do not print any leading headers. |
| 296 | |
| 297 | .. option:: --no-symbolic-operands |
| 298 | |
| 299 | Do not print symbolic operands when disassembling. |
| 300 | |
| 301 | .. option:: --non-verbose |
| 302 | |
| 303 | Display the information for Mach-O objects in non-verbose or numeric form. |
| 304 | |
| 305 | .. option:: --objc-meta-data |
| 306 | |
| 307 | Display the Objective-C runtime meta data. |
| 308 | |
| 309 | .. option:: --private-header |
| 310 | |
| 311 | Display only the first format specific file header. |
| 312 | |
| 313 | .. option:: --rebase |
| 314 | |
| 315 | Display rebasing information. |
| 316 | |
| 317 | .. option:: --universal-headers |
| 318 | |
| 319 | Display universal headers. |
| 320 | |
| 321 | .. option:: --weak-bind |
| 322 | |
| 323 | Display weak binding information. |
| 324 | |
Michael Trent | 4a68586 | 2018-08-08 14:39:22 +0000 | [diff] [blame] | 325 | BUGS |
| 326 | ---- |
| 327 | |
| 328 | To report bugs, please visit <http://llvm.org/bugs/>. |
| 329 | |
| 330 | SEE ALSO |
| 331 | -------- |
| 332 | |
James Henderson | a8ed354 | 2019-06-21 10:12:53 +0000 | [diff] [blame] | 333 | :manpage:`llvm-nm(1)`, :manpage:`llvm-readobj(1)` |