14 #ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
15 #define LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
52 explicit operator bool()
const {
return Address != 0; }
64 : RTDyld(RTDyld), BeginIdx(BeginIdx), EndIdx(EndIdx) { }
82 std::unique_ptr<llvm::LoadedObjectInfo>
clone()
const override {
83 return llvm::make_unique<Derived>(
static_cast<const Derived &
>(*this));
106 bool IsReadOnly) = 0;
117 uintptr_t DataSizeRO,
118 uintptr_t DataSizeRW) {}
146 virtual void anchor();
181 virtual void anchor();
185 RuntimeDyld(MemoryManager &MemMgr, SymbolResolver &Resolver);
231 assert(!Dyld &&
"setProcessAllSections must be called before loadObject.");
232 this->ProcessAllSections = ProcessAllSections;
238 std::unique_ptr<RuntimeDyldImpl> Dyld;
239 MemoryManager &MemMgr;
240 SymbolResolver &Resolver;
241 bool ProcessAllSections;
Information about the loaded object.
std::unique_ptr< LoadedObjectInfo > loadObject(const object::ObjectFile &O)
Add the referenced object file to the list of objects to be loaded and relocated. ...
void registerEHFrames()
Register any EH frame sections that have been loaded but not previously registered with the memory ma...
virtual ~SymbolResolver()
StringRef getErrorString()
uint64_t getAddress() const
This class is the base class for all object file types.
Base class for symbols in the JIT.
void deregisterEHFrames()
SymbolInfo getSymbol(StringRef Name) const
Get the target address and flags for the named symbol.
SymbolInfo(uint64_t Address, JITSymbolFlags Flags)
virtual bool needsToReserveAllocationSpace()
Override to return true to enable the reserveAllocationSpace callback.
virtual void deregisterEHFrames(uint8_t *addr, uint64_t LoadAddr, size_t Size)=0
virtual void reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW)
Inform the memory manager about the total amount of memory required to allocate all sections to be lo...
void * getSymbolLocalAddress(StringRef Name) const
Get the address of our local copy of the symbol.
void setProcessAllSections(bool ProcessAllSections)
By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded.
virtual bool finalizeMemory(std::string *ErrMsg=nullptr)=0
This method is called when object loading is complete and section page permissions can be applied...
JITSymbolFlags
Flags for symbols in the JIT.
LoadedObjectInfo(RuntimeDyldImpl &RTDyld, unsigned BeginIdx, unsigned EndIdx)
virtual SymbolInfo findSymbol(const std::string &Name)=0
This method returns the address of the specified function or variable.
LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, unsigned BeginIdx, unsigned EndIdx)
virtual uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly)=0
Allocate a memory block of (at least) the given size suitable for data.
virtual uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)=0
Allocate a memory block of (at least) the given size suitable for executable code.
virtual object::OwningBinary< object::ObjectFile > getObjectForDebug(const object::ObjectFile &Obj) const =0
uint64_t TargetAddress
Represents an address in the target process's address space.
uint64_t getSectionLoadAddress(StringRef Name) const
Obtain the Load Address of a section by Name.
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
virtual SymbolInfo findSymbolInLogicalDylib(const std::string &Name)=0
This method returns the address of the specified symbol if it exists within the logical dynamic libra...
std::unique_ptr< llvm::LoadedObjectInfo > clone() const override
Obtain a copy of this LoadedObjectInfo.
Information about a named symbol.
void resolveRelocations()
Resolve the relocations for all symbols we currently know about.
SymbolInfo(std::nullptr_t)
void reassignSectionAddress(unsigned SectionID, uint64_t Addr)
StringRef - Represent a constant reference to a string, i.e.
virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size)=0
Register the EH frames with the runtime so that c++ exceptions work.
void mapSectionAddress(const void *LocalAddress, uint64_t TargetAddress)
Map a section to its target address space value.