llvm-project/llvm/test/tools/llvm-objdump
Dave Lee 3fb120f12e objdump: Better handling of Mach-O universal binaries
Summary:
With Mach-O, there is a flag requirement discrepancy between working with
universal binaries and thin binaries. Many flags that don't require the `-macho`
flag (for example `-private-headers` and `-disassemble`) fail to work on
universal binaries unless `-macho` is given. When this happens, the error
message is unhelpful, stating:

    The file was not recognized as a valid object file.

Which can lead to confusion.

This change allows generic flags to be used on universal binaries with and
without the `-macho` flag. This means flags that can be used for thin files can
be used consistently with fat files too.

To do this, the universal binary support within `ParseInputMachO()` is extracted
into a new function. This new function is called directly from `DumpInput()`
when the input binary is universal. Additionally the `-arch` flag validation in
`ParseInputMachO()` was extracted to be reused.

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: keith, llvm-commits

Differential Revision: https://reviews.llvm.org/D48702

llvm-svn: 338792
2018-08-03 00:06:38 +00:00
..
AArch64 [llvm-objdump] Print "..." instead of random data for virtual sections 2018-04-19 17:02:57 +00:00
AMDGPU [SelectionDAG] Remove debug locations from ConstantSD(FP)Nodes 2018-06-25 17:06:18 +00:00
ARM ARM: add binary file git swallowed. 2018-06-26 12:28:47 +00:00
Hexagon [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
Inputs [llvm-objdump] Add dynamic section printing to private-headers option 2018-07-25 11:09:20 +00:00
Mips
WebAssembly [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
X86 objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
archive-headers.test [llvm-objcopy] Fix timezone dependant tests 2018-07-05 15:24:11 +00:00
call-absolute-symbol-elf.test Require x86 for this test. 2018-06-28 23:22:14 +00:00
coff-file.test
coff-import-library.test
coff-large-bss.test
coff-many-relocs.test
coff-non-null-terminated-file.test
coff-private-headers.test
common-symbol-elf.test
eh_frame-arm64.test
eh_frame-mipsel.test
eh_frame_zero_cie.test
embedded-source.test [DebugInfo] Fix buildbot failure on non-X86 targets 2018-02-24 16:25:43 +00:00
file-headers-coff.test [llvm-objdump] Add --file-headers (-f) option 2018-07-04 15:25:03 +00:00
file-headers-elf.test [llvm-objdump] Add --file-headers (-f) option 2018-07-04 15:25:03 +00:00
file-headers-pe.test [llvm-objdump] Add --file-headers (-f) option 2018-07-04 15:25:03 +00:00
file-headers-unsupported.test [llvm-objdump] Add --file-headers (-f) option 2018-07-04 15:25:03 +00:00
hex-relocation-addr.test
invalid-input.test
macho-LLVM-bundle.test
macho-bad-bind.test
macho-bad-ordinal.test
macho-bad-trie.test
macho-bind.test
macho-bind2.test
macho-compact-unwind-i386.test
macho-compact-unwind-x86_64.test
macho-exports-trie.test
macho-lazy-bind.test
macho-objc-meta-data.test
macho-rebase.test
macho-sections.test
macho-unwind-info-arm64.test
macho-unwind-info-no-relocs.test
macho-unwind-info-x86_64.test
macho-weak-bind.test
malformed-archives.test
malformed-macho.test
malformed-unwind-x86_64.test
private-headers-dynamic-section.test [llvm-objdump] Add dynamic section printing to private-headers option 2018-07-25 11:09:20 +00:00
private-headers-no-dynamic-segment.test [llvm-objdump] Add dynamic section printing to private-headers option 2018-07-25 11:09:20 +00:00
private-headers-no-dynamic.test [llvm-objdump] Add dynamic section printing to private-headers option 2018-07-25 11:09:20 +00:00
proc-specific-section-elf.test
section-filter.test
wasm-corrupt-section.test
wasm.txt [WebAssembly] Add version to object file metadata 2018-04-26 18:15:32 +00:00
win64-unwind-data.test