1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/tools/llvm-objdump
Dave Lee 956ce46fd0 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
..
CMakeLists.txt Fix debug build by adding missing dependencies on libBinaryFormat 2018-05-15 00:46:43 +00:00
COFFDump.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ELFDump.cpp [llvm-objdump] Add dynamic section printing to private-headers option 2018-07-25 11:09:20 +00:00
llvm-objdump.cpp objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
llvm-objdump.h objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
LLVMBuild.txt
MachODump.cpp objdump: Better handling of Mach-O universal binaries 2018-08-03 00:06:38 +00:00
WasmDump.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00