diff options
author | Rui Ueyama <ruiu@google.com> | 2013-06-12 19:10:33 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-06-12 19:10:33 +0000 |
commit | 82ebd8e36daf3da080908dc466e9a2edfc93a955 (patch) | |
tree | 62cf206f39a80b96f82899bc95a58a78514e9946 /llvm/lib/Object/Binary.cpp | |
parent | f370ad905571dd9e51b26eee7d75ceb95268a771 (diff) | |
download | bcm5719-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.cpp | 6 |
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; } |