summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-06-12 19:10:33 +0000
committerRui Ueyama <ruiu@google.com>2013-06-12 19:10:33 +0000
commit82ebd8e36daf3da080908dc466e9a2edfc93a955 (patch)
tree62cf206f39a80b96f82899bc95a58a78514e9946 /llvm/lib/Object/Binary.cpp
parentf370ad905571dd9e51b26eee7d75ceb95268a771 (diff)
downloadbcm5719-llvm-82ebd8e36daf3da080908dc466e9a2edfc93a955.tar.gz
bcm5719-llvm-82ebd8e36daf3da080908dc466e9a2edfc93a955.zip
readobj: Dump PE/COFF optional records.
These records are mandatory for executables and are used by the loader. Reviewers: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D939 llvm-svn: 183852
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r--llvm/lib/Object/Binary.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp
index 201899ffe2e..a1497708c1e 100644
--- a/llvm/lib/Object/Binary.cpp
+++ b/llvm/lib/Object/Binary.cpp
@@ -84,8 +84,10 @@ error_code object::createBinary(MemoryBuffer *Source,
}
case sys::fs::file_magic::coff_object:
case sys::fs::file_magic::pecoff_executable: {
- OwningPtr<Binary> ret(new COFFObjectFile(scopedSource.take(), ec));
- if (ec) return ec;
+ OwningPtr<Binary> ret(
+ ObjectFile::createCOFFObjectFile(scopedSource.take()));
+ if (!ret)
+ return object_error::invalid_file_type;
Result.swap(ret);
return object_error::success;
}
OpenPOWER on IntegriCloud