From ca8b2c655eb4d283187cbbb4f0f3acd34f60fa1c Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Fri, 20 Apr 2012 18:32:49 +0800 Subject: Add libLLVMObject to read executable file. Change-Id: I9ce8742d12fd3d9c57cec182e76c7385d3f0e3bc --- lib/Object/Android.mk | 40 ++++++++++++++++++++++++++++++++++++++++ lib/Object/COFFObjectFile.cpp | 2 ++ lib/Object/ELFObjectFile.cpp | 2 ++ 3 files changed, 44 insertions(+) create mode 100644 lib/Object/Android.mk (limited to 'lib') diff --git a/lib/Object/Android.mk b/lib/Object/Android.mk new file mode 100644 index 0000000..d7ba85d --- /dev/null +++ b/lib/Object/Android.mk @@ -0,0 +1,40 @@ +LOCAL_PATH := $(call my-dir) + +object_SRC_FILES := \ + Archive.cpp \ + Binary.cpp \ + COFFObjectFile.cpp \ + ELFObjectFile.cpp \ + Error.cpp \ + MachOObject.cpp \ + MachOObjectFile.cpp \ + Object.cpp \ + ObjectFile.cpp + + +# For the host +# ===================================================== +include $(CLEAR_VARS) +include $(CLEAR_TBLGEN_VARS) + +LOCAL_MODULE:= libLLVMObject +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(object_SRC_FILES) + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device only +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_MODULE:= libLLVMObject +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(object_SRC_FILES) + +include $(LLVM_DEVICE_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_STATIC_LIBRARY) diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index b8ba905..ec26096 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -17,6 +17,8 @@ #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Triple.h" +#include + using namespace llvm; using namespace object; diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index ab5f810..8e1dba9 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -13,6 +13,8 @@ #include "llvm/Object/ELF.h" +#include + namespace llvm { using namespace object; -- cgit v1.1