llvm-project/llvm/test/tools/llvm-objdump/X86
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
..
Inputs For llvm-objdump and Mach-O files, fix the printing of module init and 2018-03-20 20:29:52 +00:00
coff-dis-internal.test
coff-disassemble-export.test
debug-info-fileinfo.test
disasm-specific-funcs.test [llvm-objdump] Support disassembling by symbol name 2018-03-09 19:13:44 +00:00
disassemble-code-data-mix.s
disassemble-data.test
disassemble-demangle.test [llvm-objdump] Add -demangle (-C) option 2018-07-18 16:39:21 +00:00
disassembly-show-raw.test
hex-displacement.test Fix tests after move to utohexstr. 2017-12-28 17:00:37 +00:00
invalid-macho-build-version.yaml
lit.local.cfg
macho-archive-headers.test
macho-build-version.yaml
macho-cstring-dump.test
macho-dis-no-leading-addr.test
macho-dis-symname.test
macho-disassembly-kextbundle.test
macho-disassembly-stripped.test
macho-dylib.test
macho-image-info.test Reapply: "objdump: Support newer ObjC image info flags" 2018-07-06 05:11:35 +00:00
macho-indirect-symbols.test
macho-info-plist-nofollow.test
macho-info-plist.test
macho-literal-pointers-i386.test
macho-literal-pointers-x86_64.test
macho-literals.test
macho-nofirst-symbol-disassembly.test
macho-nontext-disasm.test
macho-objc-meta-data.test
macho-preload-relocations.test Updated llvm-objdump to display local relocations in Mach-O binaries 2017-12-15 17:57:40 +00:00
macho-print-thread.test
macho-private-header.test
macho-private-headers.test objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
macho-relocations.test Updated llvm-objdump to display local relocations in Mach-O binaries 2017-12-15 17:57:40 +00:00
macho-section-contents.test
macho-section-headers.test
macho-section.test For llvm-objdump and Mach-O files, fix the printing of module init and 2018-03-20 20:29:52 +00:00
macho-stub-nosyms-disassembly.test
macho-symbol-table.test
macho-symbolized-disassembly.test
macho-symbolized-subtractor-i386.test
macho-symbolized-subtractor.test
macho-universal-x86_64.i386.test objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
macho-unwind-info.test
malformed-machos.test Updated llvm-objdump to display local relocations in Mach-O binaries 2017-12-15 17:57:40 +00:00
openbsd-headers.test
out-of-section-sym.test
phdrs.test
section-index.s [llvm-objdump] - Stop reporting bogus section IDs. 2018-07-18 08:34:35 +00:00
source-interleave-x86_64.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
start-stop-address.test
stripped-shared.test
stubbed-dylib.test
truncated-section.test