Go to the documentation of this file.
14 #ifndef LLVM_EXECUTIONENGINE_ORC_EPCGENERICRTDYLDMEMORYMANAGER_H
15 #define LLVM_EXECUTIONENGINE_ORC_EPCGENERICRTDYLDMEMORYMANAGER_H
20 #define DEBUG_TYPE "orc"
61 bool IsReadOnly)
override;
64 uintptr_t RODataSize,
uint32_t RODataAlign,
84 Contents(
std::make_unique<uint8_t[]>(Size +
Align - 1)) {}
88 std::unique_ptr<uint8_t[]> Contents;
96 AllocGroup() =
default;
97 AllocGroup(
const AllocGroup &) =
delete;
98 AllocGroup &
operator=(
const AllocGroup &) =
delete;
99 AllocGroup(AllocGroup &&) =
default;
100 AllocGroup &
operator=(AllocGroup &&) =
default;
102 ExecutorAddrRange RemoteCode;
103 ExecutorAddrRange RemoteROData;
104 ExecutorAddrRange RemoteRWData;
105 std::vector<ExecutorAddrRange> UnfinalizedEHFrames;
106 std::vector<Alloc> CodeAllocs, RODataAllocs, RWDataAllocs;
110 void mapAllocsToRemoteAddrs(
RuntimeDyld &Dyld, std::vector<Alloc> &Allocs,
111 ExecutorAddr NextAddr);
113 ExecutorProcessControl &EPC;
117 std::vector<AllocGroup> Unmapped;
118 std::vector<AllocGroup> Unfinalized;
119 std::vector<ExecutorAddr> FinalizedAllocs;
128 #endif // LLVM_EXECUTIONENGINE_ORC_EPCGENERICRTDYLDMEMORYMANAGER_H
Represents an address in the executor process.
void deregisterEHFrames() override
This is an optimization pass for GlobalISel generic memory operations.
ExecutorAddr DeregisterEHFrame
void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign, uintptr_t RODataSize, uint32_t RODataAlign, uintptr_t RWDataSize, uint32_t RWDataAlign) override
Inform the memory manager about the total amount of memory required to allocate all sections to be lo...
EPCGenericRTDyldMemoryManager & operator=(const EPCGenericRTDyldMemoryManager &)=delete
uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName) override
Allocate a memory block of (at least) the given size suitable for executable code.
ExecutorProcessControl supports interaction with a JIT target process.
Tagged union holding either a T or a Error.
void notifyObjectLoaded(RuntimeDyld &Dyld, const object::ObjectFile &Obj) override
This method is called after an object has been loaded into memory but before relocations are applied ...
static Expected< std::unique_ptr< EPCGenericRTDyldMemoryManager > > CreateWithDefaultBootstrapSymbols(ExecutorProcessControl &EPC)
Create an EPCGenericRTDyldMemoryManager using the given EPC, looking up the default symbol names in t...
Symbol addresses for memory access.
uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly) override
Allocate a memory block of (at least) the given size suitable for data.
void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) override
Register the EH frames with the runtime so that c++ exceptions work.
bool needsToReserveAllocationSpace() override
Override to return true to enable the reserveAllocationSpace callback.
This struct is a compact representation of a valid (non-zero power of two) alignment.
StringRef - Represent a constant reference to a string, i.e.
This class is the base class for all object file types.
EPCGenericRTDyldMemoryManager(ExecutorProcessControl &EPC, SymbolAddrs SAs)
Create an EPCGenericRTDyldMemoryManager using the given EPC and symbol addrs.
Remote-mapped RuntimeDyld-compatible memory manager.
ExecutorAddr RegisterEHFrame
~EPCGenericRTDyldMemoryManager()
bool finalizeMemory(std::string *ErrMsg=nullptr) override
This method is called when object loading is complete and section page permissions can be applied.