mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
RuntimeDyld should use the memory manager API.
Start teaching the runtime Dyld interface to use the memory manager API for allocating space. Rather than mapping directly into the MachO object, we extract the payload for each object and copy it into a dedicated buffer allocated via the memory manager. For now, just do Segment64, so this works on x86_64, but not yet on ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,14 +44,14 @@ Action(cl::desc("Action to perform:"),
|
||||
// support library allocation routines directly.
|
||||
class TrivialMemoryManager : public RTDyldMemoryManager {
|
||||
public:
|
||||
uint64_t startFunctionBody(const char *Name, uintptr_t &Size);
|
||||
void endFunctionBody(const char *Name, uint64_t FunctionStart,
|
||||
uint64_t FunctionEnd) {}
|
||||
uint8_t *startFunctionBody(const char *Name, uintptr_t &Size);
|
||||
void endFunctionBody(const char *Name, uint8_t *FunctionStart,
|
||||
uint8_t *FunctionEnd) {}
|
||||
};
|
||||
|
||||
uint64_t TrivialMemoryManager::startFunctionBody(const char *Name,
|
||||
uint8_t *TrivialMemoryManager::startFunctionBody(const char *Name,
|
||||
uintptr_t &Size) {
|
||||
return (uint64_t)sys::Memory::AllocateRWX(Size, 0, 0).base();
|
||||
return (uint8_t*)sys::Memory::AllocateRWX(Size, 0, 0).base();
|
||||
}
|
||||
|
||||
static const char *ProgramName;
|
||||
|
Reference in New Issue
Block a user