393 lines · plain
1llvm-readobj - LLVM Object Reader2=================================3 4.. program:: llvm-readobj5 6SYNOPSIS7--------8 9:program:`llvm-readobj` [*options*] [*input...*]10 11DESCRIPTION12-----------13 14The :program:`llvm-readobj` tool displays low-level format-specific information15about one or more object files.16 17If ``input`` is "``-``", :program:`llvm-readobj` reads from standard18input. Otherwise, it will read from the specified ``filenames``.19 20DIFFERENCES TO LLVM-READELF21---------------------------22 23:program:`llvm-readelf` is an alias for the :manpage:`llvm-readobj` tool with a24slightly different command-line interface and output that is GNU compatible.25Following is a list of differences between :program:`llvm-readelf` and26:program:`llvm-readobj`:27 28- :program:`llvm-readelf` uses `GNU` for the :option:`--elf-output-style` option29 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 for34 :option:`--symbols`, for GNU :program:`readelf` compatibility, whereas it is35 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`` as39 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 conflicting42 with grouped flags.43 44GENERAL AND MULTI-FORMAT OPTIONS45--------------------------------46 47These options are applicable to more than one file format, or are unrelated to48file formats.49 50.. option:: --all51 52 Equivalent to specifying all the main display options relevant to the file53 format.54 55.. option:: --addrsig56 57 Display the address-significance table.58 59.. option:: --decompress, -z60 61 Dump decompressed section content when used with ``-x`` or ``-p``.62 If the section(s) are not compressed, they are displayed as is.63 64.. option:: --demangle, -C65 66 Display demangled symbol names in the output. This option is only for ELF and67 XCOFF file formats.68 69.. option:: --expand-relocs70 71 When used with :option:`--relocs`, display each relocation in an expanded72 multi-line format.73 74.. option:: --file-header, -h75 76 Display file headers.77 78.. option:: --headers, -e79 80 Equivalent to setting: :option:`--file-header`, :option:`--program-headers`,81 and :option:`--sections`.82 83.. option:: --help84 85 Display a summary of command line options.86 87.. option:: --hex-dump=<section[,section,...]>, -x88 89 Display the specified section(s) as hexadecimal bytes. ``section`` may be a90 section index or section name.91 92 .. option:: --memtag93 94 Display information about memory tagging present in the binary. This includes95 various memtag-specific dynamic entries, decoded global descriptor sections,96 and decoded Android-specific ELF notes.97 98.. option:: --needed-libs99 100 Display the needed libraries.101 102.. option:: --no-demangle103 104 Do not demangle symbol names in the output. This option is only for ELF and105 XCOFF file formats. The option is enabled by default.106 107.. option:: --offloading108 109 Display list of HIP offload bundles.110 111.. option:: --relocations, --relocs, -r112 113 Display the relocation entries in the file.114 115.. option:: --sections, --section-headers, -S116 117 Display all sections.118 119.. option:: --section-data, --sd120 121 When used with :option:`--sections`, display section data for each section122 shown. This option has no effect for GNU style output.123 124.. option:: --section-relocations, --sr125 126 When used with :option:`--sections`, display relocations for each section127 shown. This option has no effect for GNU style output.128 129.. option:: --section-symbols, --st130 131 When used with :option:`--sections`, display symbols for each section shown.132 This option has no effect for GNU style output.133 134.. option:: --sort-symbols=<sort_key[,sort_key]>135 136 Specify the keys to sort symbols before displaying symtab.137 Valid values for sort_key are ``name`` and ``type``.138.. option:: --stackmap139 140 Display contents of the stackmap section.141 142.. option:: --string-dump=<section[,section,...]>, -p143 144 Display the specified section(s) as a list of strings. ``section`` may be a145 section index or section name.146 147.. option:: --string-table148 149 Display contents of the string table.150 151.. option:: --symbols, --syms, -s152 153 Display the symbol table.154 155.. option:: --unwind, -u156 157 Display unwind information.158 159.. option:: --version160 161 Display the version of the :program:`llvm-readobj` executable.162 163.. option:: @<FILE>164 165 Read command-line options from response file `<FILE>`.166 167ELF SPECIFIC OPTIONS168--------------------169 170The following options are implemented only for the ELF file format.171 172.. option:: --arch-specific, -A173 174 Display architecture-specific information, e.g. the ARM attributes section on ARM.175 176.. option:: --bb-addr-map177 178 Display the contents of the basic block address map section(s), which contain the179 address of each function, along with the relative offset of each basic block.180 181 When pgo analysis maps are present, all analyses are printed as their raw182 value.183 184.. option:: --pretty-pgo-analysis-map185 186 When pgo analysis maps are present in the basic block address map section(s),187 analyses with special formats (i.e. BlockFrequency, BranchProbability, etc)188 are printed using the same format as their respective analysis pass.189 190 Requires :option:`--bb-addr-map` to have an effect.191 192.. option:: --dependent-libraries193 194 Display the dependent libraries section.195 196.. option:: --dyn-relocations197 198 Display the dynamic relocation entries.199 200.. option:: --dyn-symbols, --dyn-syms, --dt201 202 Display the dynamic symbol table.203 204.. option:: --dynamic-table, --dynamic, -d205 206 Display the dynamic table.207 208.. option:: --cg-profile209 210 Display the callgraph profile section.211 212.. option:: --histogram, -I213 214 Display a bucket list histogram for dynamic symbol hash tables.215 216.. option:: --elf-linker-options217 218 Display the linker options section.219 220.. option:: --elf-output-style=<value>221 222 Format ELF information in the specified style. Valid options are ``LLVM``,223 ``GNU``, and ``JSON``. ``LLVM`` output (the default) is an expanded and224 structured format. ``GNU`` output mimics the equivalent GNU :program:`readelf`225 output. ``JSON`` is JSON formatted output intended for machine consumption.226 227.. option:: --section-groups, -g228 229 Display section groups.230 231.. option:: --gnu-hash-table232 233 Display the GNU hash table for dynamic symbols.234 235.. option:: --hash-symbols236 237 Display the expanded hash table with dynamic symbol data.238 239.. option:: --hash-table240 241 Display the hash table for dynamic symbols.242 243.. option:: --memtag244 245 Display information about memory tagging present in the binary. This includes246 various dynamic entries, decoded global descriptor sections, and decoded247 Android-specific ELF notes.248 249.. option:: --notes, -n250 251 Display all notes.252 253.. option:: --pretty-print254 255 When used with :option:`--elf-output-style`, JSON output will be formatted in256 a more readable format.257 258.. option:: --program-headers, --segments, -l259 260 Display the program headers.261 262.. option:: --section-mapping263 264 Display the section to segment mapping.265 266.. option:: --stack-sizes267 268 Display the contents of the stack sizes section(s), i.e. pairs of function269 names and the size of their stack frames. Currently only implemented for GNU270 style output.271 272.. option:: --version-info, -V273 274 Display version sections.275 276MACH-O SPECIFIC OPTIONS277-----------------------278 279The following options are implemented only for the Mach-O file format.280 281.. option:: --macho-data-in-code282 283 Display the Data in Code command.284 285.. option:: --macho-dsymtab286 287 Display the Dsymtab command.288 289.. option:: --macho-indirect-symbols290 291 Display indirect symbols.292 293.. option:: --macho-linker-options294 295 Display the Mach-O-specific linker options.296 297.. option:: --macho-segment298 299 Display the Segment command.300 301.. option:: --macho-version-min302 303 Display the version min command.304 305PE/COFF SPECIFIC OPTIONS306------------------------307 308The following options are implemented only for the PE/COFF file format.309 310.. option:: --codeview311 312 Display CodeView debug information.313 314.. option:: --codeview-ghash315 316 Enable global hashing for CodeView type stream de-duplication.317 318.. option:: --codeview-merged-types319 320 Display the merged CodeView type stream.321 322.. option:: --codeview-subsection-bytes323 324 Dump raw contents of CodeView debug sections and records.325 326.. option:: --coff-basereloc327 328 Display the .reloc section.329 330.. option:: --coff-debug-directory331 332 Display the debug directory.333 334.. option:: --coff-tls-directory335 336 Display the TLS directory.337 338.. option:: --coff-directives339 340 Display the .drectve section.341 342.. option:: --coff-exports343 344 Display the export table.345 346.. option:: --coff-imports347 348 Display the import table.349 350.. option:: --coff-load-config351 352 Display the load config.353 354.. option:: --coff-resources355 356 Display the .rsrc section.357 358XCOFF SPECIFIC OPTIONS359----------------------360 361The following options are implemented only for the XCOFF file format.362 363.. option:: --auxiliary-header364 365 Display XCOFF Auxiliary header.366 367.. option:: --exception-section368 369 Display XCOFF exception section entries.370 371.. option:: --loader-section-header372 373 Display XCOFF loader section header.374 375.. option:: --loader-section-symbols376 377 Display symbol table of loader section.378 379.. option:: --loader-section-relocations380 381 Display relocation entries of loader section.382 383EXIT STATUS384-----------385 386:program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero387exit code if there were any errors.388 389SEE ALSO390--------391 392:manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`393