llvm-project/llvm/test/tools
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
..
dsymutil [dsymutil] Simplify temporary file handling. 2018-07-29 14:56:15 +00:00
gold Revert "Enrich inline messages", tests fail 2018-08-01 08:02:40 +00:00
llvm-ar [llvm-ar] Fix help text test. NFC. 2018-08-02 12:27:01 +00:00
llvm-cfi-verify [cfi-verify] Abort on unsupported targets 2018-07-16 15:26:44 +00:00
llvm-config llvm-config: Add advapi32 to --system-libs on Windows (PR36372) 2018-02-23 12:20:26 +00:00
llvm-cov [llvm-cov] Use the new PrintHTMLEscaped utility 2018-05-30 23:35:14 +00:00
llvm-cvtres [llvm-cvtres] Allow parameters preceded by '-' in addition to '/' 2018-05-02 21:15:13 +00:00
llvm-cxxdump
llvm-cxxfilt Add test for demangling GNU ABI tags. 2018-03-22 22:04:32 +00:00
llvm-diff Let llvm-diff correctly deal with Undef/ConstantAggregateZero/ConstantVector/IndirectBr 2018-04-12 21:28:04 +00:00
llvm-dlltool [COFF] Adjust how we flag weak externals 2018-07-20 20:48:29 +00:00
llvm-dwarfdump [DWARF] Support for .debug_addr (consumer) 2018-07-31 22:19:19 +00:00
llvm-dwp llvm-dwarfdump: automatically dump both regular and .dwo variant of sections 2017-09-13 22:09:01 +00:00
llvm-extract BlockExtractor: Don’t delete functions directly 2018-03-12 22:28:18 +00:00
llvm-isel-fuzzer Revert r326710 "Fuzzer: remove temporary files after we're done with them." 2018-03-12 13:22:12 +00:00
llvm-lib Attempt to get test/tools/llvm-lib/help.test passing on sanitizer-x86_64-linux-fast 2018-07-14 11:33:33 +00:00
llvm-lit
llvm-lto [ThinLTO] Serialize WithGlobalValueDeadStripping index flag for distributed backends 2018-02-07 04:05:59 +00:00
llvm-lto2 Fix test by allowing it to accept an upper or lower case letter as the first character. 2018-04-20 15:23:57 +00:00
llvm-mc Replace unused output filenames with /dev/null in tests 2018-07-02 18:16:44 +00:00
llvm-mca [llvm-mca][x86] Add CMPXCHG instruction resource tests 2018-08-01 17:25:11 +00:00
llvm-modextract
llvm-mt [llvm-mt] Use WithColor for printing errors. 2018-06-23 16:49:07 +00:00
llvm-nm nm: Add -no-weak flag for hiding weak symbols 2018-07-02 17:24:37 +00:00
llvm-objcopy [llvm-objcopy] Add support for --rename-section flags from gnu objcopy 2018-08-01 16:23:22 +00:00
llvm-objdump objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
llvm-opt-fuzzer Revert r326710 "Fuzzer: remove temporary files after we're done with them." 2018-03-12 13:22:12 +00:00
llvm-opt-report
llvm-pdbdump win: try to fix dia tests with newer msvc versions 2018-05-21 02:09:57 +00:00
llvm-profdata Revert "Revert "[lit] Generalized /dev/null support on Windows."" 2018-03-27 01:39:17 +00:00
llvm-rc [llvm-rc] Add support for the optional CLASS statement for dialogs 2018-05-15 19:21:28 +00:00
llvm-readobj [llvm-readobj] Generic hex-dump option 2018-07-25 10:04:37 +00:00
llvm-size
llvm-split Make GlobalValues with non-default visibilility dso_local. 2018-01-18 02:08:23 +00:00
llvm-strings [llvm-strings] Add support for the -a/--all options 2017-11-14 19:58:36 +00:00
llvm-symbolizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
llvm-xray/X86 [XRay][compiler-rt] Add PID field to llvm-xray tool and add PID metadata record entry in FDR mode 2018-07-13 05:38:22 +00:00
lto Move `REQUIRES:` line to the top 2018-06-26 17:44:23 +00:00
obj2yaml [obj2yaml] Don't crash for input files without symbol table 2017-09-22 09:30:40 +00:00
opt-viewer [opt-viewer] Set title for the source pages 2018-02-26 21:15:50 +00:00
sancov
sanstats
yaml2obj [yaml2obj] Add default sh_entsize for dynamic sections 2018-07-23 18:49:04 +00:00