14 #ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H 15 #define LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H 30 #include <system_error> 50 std::error_code convertToErrorCode()
const override;
65 void reassignSectionAddress(
unsigned SectionID, uint64_t Addr);
76 : RTDyld(RTDyld), ObjSecToIDMap(
std::move(ObjSecToIDMap)) {}
85 virtual void anchor();
103 virtual uint8_t *allocateCodeSection(uintptr_t
Size,
unsigned Alignment,
110 virtual uint8_t *allocateDataSection(uintptr_t
Size,
unsigned Alignment,
113 bool IsReadOnly) = 0;
124 uintptr_t RODataSize,
126 uintptr_t RWDataSize,
138 virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
140 virtual void deregisterEHFrames() = 0;
151 virtual bool finalizeMemory(std::string *ErrMsg =
nullptr) = 0;
168 virtual void anchor();
170 bool FinalizationLocked =
false;
197 std::map<StringRef, JITEvaluatedSymbol> getSymbolTable()
const;
200 void resolveRelocations();
206 void mapSectionAddress(
const void *LocalAddress, uint64_t TargetAddress);
213 void registerEHFrames();
215 void deregisterEHFrames();
229 assert(!Dyld &&
"setProcessAllSections must be called before loadObject.");
230 this->ProcessAllSections = ProcessAllSections;
250 void finalizeWithMemoryManagerLocking();
255 std::unique_ptr<MemoryBuffer> UnderlyingBuffer,
257 bool ProcessAllSections,
259 std::map<StringRef, JITEvaluatedSymbol>)>
265 std::unique_ptr<RuntimeDyldImpl> Dyld;
268 bool ProcessAllSections;
279 std::unique_ptr<MemoryBuffer> UnderlyingBuffer,
283 std::map<StringRef, JITEvaluatedSymbol>)>
289 #endif // LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H virtual void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign, uintptr_t RODataSize, uint32_t RODataAlign, uintptr_t RWDataSize, uint32_t RWDataAlign)
Inform the memory manager about the total amount of memory required to allocate all sections to be lo...
Information about the loaded object.
This class represents lattice values for constants.
This class is the base class for all object file types.
void jitLinkForORC(object::ObjectFile &Obj, std::unique_ptr< MemoryBuffer > UnderlyingBuffer, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver, bool ProcessAllSections, std::function< Error(std::unique_ptr< LoadedObjectInfo >, std::map< StringRef, JITEvaluatedSymbol >)> OnLoaded, std::function< void(Error)> OnEmitted)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
virtual bool needsToReserveAllocationSpace()
Override to return true to enable the reserveAllocationSpace callback.
RuntimeDyldError(std::string ErrMsg)
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
void setProcessAllSections(bool ProcessAllSections)
By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded.
virtual void notifyObjectLoaded(RuntimeDyld &RTDyld, const object::ObjectFile &Obj)
This method is called after an object has been loaded into memory but before relocations are applied ...
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Symbol resolution interface.
ObjSectionToIDMap ObjSecToIDMap
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
Represents a symbol that has been evaluated to an address already.
Base class for user error types.
Base class for errors originating in RuntimeDyld, e.g.
const std::string & getErrorMessage() const
std::map< object::SectionRef, unsigned > ObjSectionToIDMap
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
print Print MemDeps of function
StringRef - Represent a constant reference to a string, i.e.
LoadedObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
This is a value type class that represents a single section in the list of sections in the object fil...