diff options
| author | Kevin Enderby <enderby@apple.com> | 2017-01-30 20:53:17 +0000 |
|---|---|---|
| committer | Kevin Enderby <enderby@apple.com> | 2017-01-30 20:53:17 +0000 |
| commit | 98898f2b0283629a03e52950da0007bb82b01ef7 (patch) | |
| tree | 26b91397faea65c4b97aa78511b652676061febc /llvm/tools | |
| parent | c94497048434ede852fe3db7870ba97864d8e1bf (diff) | |
| download | bcm5719-llvm-98898f2b0283629a03e52950da0007bb82b01ef7.tar.gz bcm5719-llvm-98898f2b0283629a03e52950da0007bb82b01ef7.zip | |
Change the llvm-obdump(1) behavior with the -macho flag and inappropriate file types.
To better match the old darwin otool(1) behavior, when llvm-obdump(1) is used
with the -macho option and the input file is not an object file simply print
the file name and this message:
foo: is not an object file
and continue on to process other input files. Also in this case don’t exit
non-zero. This should help in some OSS projects' with autoconf scripts
that are expecting the old darwin otool(1) behavior.
rdar://26828015
llvm-svn: 293547
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 53517c58cea..80cbe4bc657 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -1566,8 +1566,13 @@ void llvm::ParseInputMachO(StringRef Filename) { // Attempt to open the binary. Expected<OwningBinary<Binary>> BinaryOrErr = createBinary(Filename); - if (!BinaryOrErr) - report_error(Filename, BinaryOrErr.takeError()); + if (!BinaryOrErr) { + if (auto E = isNotObjectErrorInvalidFileType(BinaryOrErr.takeError())) + report_error(Filename, std::move(E)); + else + outs() << Filename << ": is not an object file\n"; + return; + } Binary &Bin = *BinaryOrErr.get().getBinary(); if (Archive *A = dyn_cast<Archive>(&Bin)) { |

