aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-09-27 19:36:55 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-09-27 19:36:55 +0000
commita51d7d97b0b8187ed68d4cbad2374f514d2cd168 (patch)
tree6903f55118203a052fd7761c8fe7b55392f902f4 /lib/Object/Binary.cpp
parent040bff0bc23bd38ad68b2de8dff8bb41706180e0 (diff)
Object: Add archive support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/Binary.cpp')
-rw-r--r--lib/Object/Binary.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Object/Binary.cpp b/lib/Object/Binary.cpp
index 4b31c7557d..3b00bebaa6 100644
--- a/lib/Object/Binary.cpp
+++ b/lib/Object/Binary.cpp
@@ -17,8 +17,9 @@
#include "llvm/Support/Path.h"
// Include headers for createBinary.
-#include "llvm/Object/ObjectFile.h"
+#include "llvm/Object/Archive.h"
#include "llvm/Object/COFF.h"
+#include "llvm/Object/ObjectFile.h"
using namespace llvm;
using namespace object;
@@ -50,6 +51,12 @@ error_code object::createBinary(MemoryBuffer *Source,
static_cast<unsigned>(Source->getBufferSize()));
error_code ec;
switch (type) {
+ case sys::Archive_FileType: {
+ OwningPtr<Binary> ret(new Archive(scopedSource.take(), ec));
+ if (ec) return ec;
+ Result.swap(ret);
+ return object_error::success;
+ }
case sys::ELF_Relocatable_FileType:
case sys::ELF_Executable_FileType:
case sys::ELF_SharedObject_FileType: