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