Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 1 | llvm-readobj - LLVM Object Reader |
| 2 | ================================= |
| 3 | |
James Henderson | a056684 | 2019-06-27 13:24:46 +0000 | [diff] [blame] | 4 | .. program:: llvm-readobj |
| 5 | |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 6 | SYNOPSIS |
| 7 | -------- |
| 8 | |
| 9 | :program:`llvm-readobj` [*options*] [*input...*] |
| 10 | |
| 11 | DESCRIPTION |
| 12 | ----------- |
| 13 | |
| 14 | The :program:`llvm-readobj` tool displays low-level format-specific information |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 15 | about one or more object files. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 16 | |
| 17 | If ``input`` is "``-``" or omitted, :program:`llvm-readobj` reads from standard |
| 18 | input. Otherwise, it will read from the specified ``filenames``. |
| 19 | |
James Henderson | 90c57e0 | 2019-07-01 16:18:57 +0000 | [diff] [blame] | 20 | DIFFERENCES TO LLVM-READELF |
| 21 | --------------------------- |
| 22 | |
| 23 | :program:`llvm-readelf` is an alias for the :manpage:`llvm-readobj` tool with a |
| 24 | slightly different command-line interface and output that is GNU compatible. |
| 25 | Following is a list of differences between :program:`llvm-readelf` and |
| 26 | :program:`llvm-readobj`: |
| 27 | |
| 28 | - :program:`llvm-readelf` uses `GNU` for the :option:`--elf-output-style` option |
| 29 | by default. :program:`llvm-readobj` uses `LLVM`. |
| 30 | - :program:`llvm-readelf` allows single-letter grouped flags (e.g. |
| 31 | ``llvm-readelf -SW`` is the same as ``llvm-readelf -S -W``). |
| 32 | :program:`llvm-readobj` does not allow grouping. |
| 33 | - :program:`llvm-readelf` provides :option:`-s` as an alias for |
| 34 | :option:`--symbols`, for GNU :program:`readelf` compatibility, whereas it is |
| 35 | an alias for :option:`--section-headers` in :program:`llvm-readobj`. |
| 36 | - :program:`llvm-readobj` provides ``-t`` as an alias for :option:`--symbols`. |
| 37 | :program:`llvm-readelf` does not. |
| 38 | - :program:`llvm-readobj` provides ``--sr``, ``--sd``, ``--st`` and ``--dt`` as |
| 39 | aliases for :option:`--section-relocations`, :option:`--section-data`, |
| 40 | :option:`--section-symbols` and :option:`--dyn-symbols` respectively. |
| 41 | :program:`llvm-readelf` does not provide these aliases, to avoid conflicting |
| 42 | with grouped flags. |
| 43 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 44 | GENERAL AND MULTI-FORMAT OPTIONS |
| 45 | -------------------------------- |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 46 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 47 | These options are applicable to more than one file format, or are unrelated to |
| 48 | file formats. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 49 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 50 | .. option:: --all |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 51 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 52 | Equivalent to specifying all the main display options relevant to the file |
| 53 | format. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 54 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 55 | .. option:: --addrsig |
| 56 | |
| 57 | Display the address-significance table. |
| 58 | |
| 59 | .. option:: --color |
| 60 | |
| 61 | Use colors in the output for warnings and errors. |
| 62 | |
| 63 | .. option:: --expand-relocs |
| 64 | |
| 65 | When used with :option:`--relocations`, display each relocation in an expanded |
| 66 | multi-line format. |
| 67 | |
| 68 | .. option:: --file-headers, -h |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 69 | |
| 70 | Display file headers. |
| 71 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 72 | .. option:: --headers, -e |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 73 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 74 | Equivalent to setting: :option:`--file-headers`, :option:`--program-headers`, |
| 75 | and :option:`--sections`. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 76 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 77 | .. option:: --help |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 78 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 79 | Display a summary of command line options. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 80 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 81 | .. option:: --help-list |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 82 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 83 | Display an uncategorized summary of command line options. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 84 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 85 | .. option:: --hex-dump=<section[,section,...]>, -x |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 86 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 87 | Display the specified section(s) as hexadecimal bytes. ``section`` may be a |
| 88 | section index or section name. |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 89 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 90 | .. option:: --needed-libs |
| 91 | |
| 92 | Display the needed libraries. |
| 93 | |
| 94 | .. option:: --relocations, --relocs, -r |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 95 | |
| 96 | Display the relocation entries in the file. |
| 97 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 98 | .. option:: --sections, --section-headers, -s, -S |
| 99 | |
| 100 | Display all sections. |
| 101 | |
| 102 | .. option:: --section-data, --sd |
| 103 | |
James Henderson | 9e38f51 | 2019-07-05 16:38:52 +0000 | [diff] [blame] | 104 | When used with :option:`--sections`, display section data for each section |
| 105 | shown. This option has no effect for GNU style output. |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 106 | |
| 107 | .. option:: --section-relocations, --sr |
| 108 | |
James Henderson | 9e38f51 | 2019-07-05 16:38:52 +0000 | [diff] [blame] | 109 | When used with :option:`--sections`, display relocations for each section |
| 110 | shown. This option has no effect for GNU style output. |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 111 | |
| 112 | .. option:: --section-symbols, --st |
| 113 | |
| 114 | When used with :option:`--sections`, display symbols for each section shown. |
James Henderson | 9e38f51 | 2019-07-05 16:38:52 +0000 | [diff] [blame] | 115 | This option has no effect for GNU style output. |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 116 | |
| 117 | .. option:: --stackmap |
| 118 | |
| 119 | Display contents of the stackmap section. |
| 120 | |
| 121 | .. option:: --string-dump=<section[,section,...]>, -p |
| 122 | |
| 123 | Display the specified section(s) as a list of strings. ``section`` may be a |
| 124 | section index or section name. |
| 125 | |
| 126 | .. option:: --symbols, --syms, -t |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 127 | |
| 128 | Display the symbol table. |
| 129 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 130 | .. option:: --unwind, -u |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 131 | |
| 132 | Display unwind information. |
| 133 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 134 | .. option:: --version |
Nico Rieck | f3f0b79 | 2013-04-12 04:01:52 +0000 | [diff] [blame] | 135 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 136 | Display the version of this program. |
James Henderson | e50d9cb | 2019-01-17 15:34:12 +0000 | [diff] [blame] | 137 | |
James Henderson | 9485b26 | 2019-06-21 11:49:20 +0000 | [diff] [blame] | 138 | .. option:: @<FILE> |
| 139 | |
| 140 | Read command-line options from response file `<FILE>`. |
| 141 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 142 | ELF SPECIFIC OPTIONS |
| 143 | -------------------- |
| 144 | |
| 145 | The following options are implemented only for the ELF file format. |
| 146 | |
| 147 | .. option:: --arm-attributes |
| 148 | |
| 149 | Display the ARM attributes section. Only applicable for ARM architectures. |
| 150 | |
| 151 | .. option:: --demangle, -C |
| 152 | |
| 153 | Display demangled symbol names in the output. |
| 154 | |
| 155 | .. option:: --dyn-relocations |
| 156 | |
| 157 | Display the dynamic relocation entries. |
| 158 | |
| 159 | .. option:: --dyn-symbols, --dyn-syms, --dt |
| 160 | |
| 161 | Display the dynamic symbol table. |
| 162 | |
| 163 | .. option:: --dynamic-table, --dynamic, -d |
| 164 | |
| 165 | Display the dynamic table. |
| 166 | |
| 167 | .. option:: --elf-cg-profile |
| 168 | |
| 169 | Display the callgraph profile section. |
| 170 | |
| 171 | .. option:: --elf-hash-histogram, --histogram, -I |
| 172 | |
| 173 | Display a bucket list histogram for dynamic symbol hash tables. |
| 174 | |
| 175 | .. option:: --elf-linker-options |
| 176 | |
| 177 | Display the linker options section. |
| 178 | |
| 179 | .. option:: --elf-output-style=<value> |
| 180 | |
James Henderson | b52a0c0 | 2019-07-08 15:46:26 +0000 | [diff] [blame] | 181 | Format ELF information in the specified style. Valid options are ``LLVM`` and |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 182 | ``GNU``. ``LLVM`` output (the default) is an expanded and structured format, |
| 183 | whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output. |
| 184 | |
| 185 | .. option:: --elf-section-groups, --section-groups, -g |
| 186 | |
| 187 | Display section groups. |
| 188 | |
| 189 | .. option:: --gnu-hash-table |
| 190 | |
| 191 | Display the GNU hash table for dynamic symbols. |
| 192 | |
| 193 | .. option:: --hash-symbols |
| 194 | |
James Henderson | b52a0c0 | 2019-07-08 15:46:26 +0000 | [diff] [blame] | 195 | Display the expanded hash table with dynamic symbol data. |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 196 | |
| 197 | .. option:: --hash-table |
| 198 | |
| 199 | Display the hash table for dynamic symbols. |
| 200 | |
| 201 | .. option:: --notes, -n |
| 202 | |
| 203 | Display all notes. |
| 204 | |
| 205 | .. option:: --program-headers, --segments, -l |
| 206 | |
| 207 | Display the program headers. |
| 208 | |
| 209 | .. option:: --raw-relr |
| 210 | |
| 211 | Do not decode relocations in RELR relocation sections when displaying them. |
| 212 | |
| 213 | .. option:: --section-mapping |
| 214 | |
| 215 | Display the section to segment mapping. |
| 216 | |
| 217 | .. option:: --version-info, -V |
| 218 | |
| 219 | Display version sections. |
| 220 | |
| 221 | MACH-O SPECIFIC OPTIONS |
| 222 | ----------------------- |
| 223 | |
| 224 | The following options are implemented only for the Mach-O file format. |
| 225 | |
| 226 | .. option:: --macho-data-in-code |
| 227 | |
| 228 | Display the Data in Code command. |
| 229 | |
| 230 | .. option:: --macho-dsymtab |
| 231 | |
| 232 | Display the Dsymtab command. |
| 233 | |
| 234 | .. option:: --macho-indirect-symbols |
| 235 | |
| 236 | Display indirect symbols. |
| 237 | |
| 238 | .. option:: --macho-linker-options |
| 239 | |
| 240 | Display the Mach-O-specific linker options. |
| 241 | |
| 242 | .. option:: --macho-segment |
| 243 | |
| 244 | Display the Segment command. |
| 245 | |
| 246 | .. option:: --macho-version-min |
| 247 | |
| 248 | Display the version min command. |
| 249 | |
| 250 | PE/COFF SPECIFIC OPTIONS |
| 251 | ------------------------ |
| 252 | |
| 253 | The following options are implemented only for the PE/COFF file format. |
| 254 | |
| 255 | .. option:: --codeview |
| 256 | |
| 257 | Display CodeView debug information. |
| 258 | |
| 259 | .. option:: --codeview-ghash |
| 260 | |
| 261 | Enable global hashing for CodeView type stream de-duplication. |
| 262 | |
| 263 | .. option:: --codeview-merged-types |
| 264 | |
| 265 | Display the merged CodeView type stream. |
| 266 | |
| 267 | .. option:: --codeview-subsection-bytes |
| 268 | |
| 269 | Dump raw contents of CodeView debug sections and records. |
| 270 | |
| 271 | .. option:: --coff-basereloc |
| 272 | |
| 273 | Display the .reloc section. |
| 274 | |
| 275 | .. option:: --coff-debug-directory |
| 276 | |
| 277 | Display the debug directory. |
| 278 | |
| 279 | .. option:: --coff-directives |
| 280 | |
| 281 | Display the .drectve section. |
| 282 | |
| 283 | .. option:: --coff-exports |
| 284 | |
| 285 | Display the export table. |
| 286 | |
| 287 | .. option:: --coff-imports |
| 288 | |
| 289 | Display the import table. |
| 290 | |
| 291 | .. option:: --coff-load-config |
| 292 | |
| 293 | Display the load config. |
| 294 | |
| 295 | .. option:: --coff-resources |
| 296 | |
| 297 | Display the .rsrc section. |
| 298 | |
Nico Rieck | 5143243 | 2013-04-11 00:05:57 +0000 | [diff] [blame] | 299 | EXIT STATUS |
| 300 | ----------- |
| 301 | |
James Henderson | b96d9d8 | 2019-06-25 13:12:38 +0000 | [diff] [blame] | 302 | :program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero |
| 303 | exit code if there were any errors. |
| 304 | |
| 305 | SEE ALSO |
| 306 | -------- |
| 307 | |
| 308 | :manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)` |