From 0e4fa5ff365fccff46870b7d5d8d4d1d46e77986 Mon Sep 17 00:00:00 2001 From: Danil Malyshev Date: Fri, 30 Mar 2012 16:45:19 +0000 Subject: Re-factored RuntimeDyLd: 1. The main works will made in the RuntimeDyLdImpl with uses the ObjectFile class. RuntimeDyLdMachO and RuntimeDyLdELF now only parses relocations and resolve it. This is allows to make improvements of the RuntimeDyLd more easily. In addition the support for COFF can be easily added. 2. Added ARM relocations to RuntimeDyLdELF. 3. Added support for stub functions for the ARM, allowing to do a long branch. 4. Added support for external functions that are not loaded from the object files, but can be loaded from external libraries. Now MCJIT can correctly execute the code containing the printf, putc, and etc. 5. The sections emitted instead functions, thanks Jim Grosbach. MemoryManager.startFunctionBody() and MemoryManager.endFunctionBody() have been removed. 6. MCJITMemoryManager.allocateDataSection() and MCJITMemoryManager. allocateCodeSection() used JMM->allocateSpace() instead of JMM->allocateCodeSection() and JMM->allocateDataSection(), because I got an error: "Cannot allocate an allocated block!" with object file contains more than one code or data sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153754 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-rtdyld/llvm-rtdyld.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'tools/llvm-rtdyld') diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index a21fc132fe..01a7d15807 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -58,10 +58,6 @@ public: uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID); - uint8_t *startFunctionBody(const char *Name, uintptr_t &Size); - void endFunctionBody(const char *Name, uint8_t *FunctionStart, - uint8_t *FunctionEnd); - virtual void *getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure = true) { return 0; @@ -81,18 +77,6 @@ uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size, return (uint8_t*)sys::Memory::AllocateRWX(Size, 0, 0).base(); } -uint8_t *TrivialMemoryManager::startFunctionBody(const char *Name, - uintptr_t &Size) { - return (uint8_t*)sys::Memory::AllocateRWX(Size, 0, 0).base(); -} - -void TrivialMemoryManager::endFunctionBody(const char *Name, - uint8_t *FunctionStart, - uint8_t *FunctionEnd) { - uintptr_t Size = FunctionEnd - FunctionStart + 1; - FunctionMemory.push_back(sys::MemoryBlock(FunctionStart, Size)); -} - static const char *ProgramName; static void Message(const char *Type, const Twine &Msg) { -- cgit v1.2.3