llvm-objdump: Ignore non-objects in archives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144755 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer 2011-11-16 01:24:41 +00:00
parent a2a2d1fddd
commit f81285c0c5

View File

@ -556,8 +556,10 @@ static void DumpArchive(const Archive *a) {
e = a->end_children(); i != e; ++i) {
OwningPtr<Binary> child;
if (error_code ec = i->getAsBinary(child)) {
errs() << ToolName << ": '" << a->getFileName() << "': " << ec.message()
<< ".\n";
// Ignore non-object files.
if (ec != object_error::invalid_file_type)
errs() << ToolName << ": '" << a->getFileName() << "': " << ec.message()
<< ".\n";
continue;
}
if (ObjectFile *o = dyn_cast<ObjectFile>(child.get()))