LLVM: llvm::RuntimeDyldCOFFX86_64 Class Reference (original ) (raw )#include "[ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h](RuntimeDyldCOFFX86%5F%5F64%5F8h%5Fsource.html)"
Public Member Functions
RuntimeDyldCOFFX86_64 (RuntimeDyld::MemoryManager &MM, JITSymbolResolver &Resolver )
Align
getStubAlignment () override
unsigned
getMaxStubSize () const override
void
resolveRelocation (const RelocationEntry &RE, uint64_t Value ) override
A object file specific relocation resolver.
std::tuple< uint64_t , uint64_t , uint64_t >
generateRelocationStub (unsigned SectionID, StringRef TargetName, uint64_t Offset , uint64_t RelType, uint64_t Addend, StubMap &Stubs)
Expected < object::relocation_iterator >
processRelocationRef (unsigned SectionID, object::relocation_iterator RelI, const object::ObjectFile &Obj, ObjSectionToIDMap &ObjSectionToID, StubMap &Stubs) override
Parses one or more object file relocations (some object files use relocation pairs) and stores it to Relocations or SymbolRelocations (this depends on the object file type).
void
registerEHFrames () override
Error
finalizeLoad (const object::ObjectFile &Obj, ObjSectionToIDMap &SectionMap) override
Public Member Functions inherited from llvm::RuntimeDyldCOFF
std::unique_ptr< RuntimeDyld::LoadedObjectInfo >
loadObject (const object::ObjectFile &Obj) override
bool
isCompatibleFile (const object::ObjectFile &Obj) const override
Public Member Functions inherited from llvm::RuntimeDyldImpl
RuntimeDyldImpl (RuntimeDyld::MemoryManager &MemMgr , JITSymbolResolver &Resolver )
virtual
~RuntimeDyldImpl ()
void
setProcessAllSections (bool ProcessAllSections )
uint64_t
getSectionLoadAddress (unsigned SectionID) const
uint8_t *
getSectionAddress (unsigned SectionID) const
StringRef
getSectionContent (unsigned SectionID) const
uint8_t *
getSymbolLocalAddress (StringRef Name) const
unsigned
getSymbolSectionID (StringRef Name) const
JITEvaluatedSymbol
getSymbol (StringRef Name) const
std::map< StringRef , JITEvaluatedSymbol >
getSymbolTable () const
void
resolveRelocations ()
void
resolveLocalRelocations ()
void
reassignSectionAddress (unsigned SectionID, uint64_t Addr)
void
mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress)
bool
hasError ()
void
clearError ()
StringRef
getErrorString ()
void
setNotifyStubEmitted (NotifyStubEmittedFunction NotifyStubEmitted )
void
deregisterEHFrames ()
Additional Inherited Members
Static Public Member Functions inherited from llvm::RuntimeDyldCOFF
static std::unique_ptr< RuntimeDyldCOFF >
create (Triple::ArchType Arch , RuntimeDyld::MemoryManager &MemMgr , JITSymbolResolver &Resolver )
Static Public Member Functions inherited from llvm::RuntimeDyldImpl
static void
finalizeAsync (std::unique_ptr< RuntimeDyldImpl > This, unique_function < void(object::OwningBinary < object::ObjectFile >, std::unique_ptr< RuntimeDyld::LoadedObjectInfo >, Error )> OnEmitted, object::OwningBinary < object::ObjectFile > O, std::unique_ptr< RuntimeDyld::LoadedObjectInfo > Info )
Protected Types inherited from llvm::RuntimeDyldImpl
typedef std::deque< SectionEntry >
SectionList
typedef unsigned
SID
typedef std::map< SectionRef , unsigned >
ObjSectionToIDMap
typedef std::vector< SymbolRef >
CommonSymbolList
typedef SmallVector < RelocationEntry , 64 >
RelocationList
typedef std::map< RelocationValueRef , uintptr_t >
StubMap
using
NotifyStubEmittedFunction
Protected Member Functions inherited from llvm::RuntimeDyldCOFF
RuntimeDyldCOFF (RuntimeDyld::MemoryManager &MemMgr , JITSymbolResolver &Resolver , unsigned PointerSize, uint32_t PointerReloc)
uint64_t
getSymbolOffset (const SymbolRef &Sym)
uint64_t
getDLLImportOffset (unsigned SectionID, StubMap &Stubs, StringRef Name, bool SetSectionIDMinus1=false)
bool
relocationNeedsDLLImportStub (const RelocationRef &R) const override
unsigned
sizeAfterAddingDLLImportStub (unsigned Size ) const override
Protected Member Functions inherited from llvm::RuntimeDyldImpl
void
writeInt16BE (uint8_t *Addr, uint16_t Value )
void
writeInt32BE (uint8_t *Addr, uint32_t Value )
void
writeInt64BE (uint8_t *Addr, uint64_t Value )
virtual void
setMipsABI (const ObjectFile &Obj)
uint64_t
readBytesUnaligned (uint8_t *Src, unsigned Size ) const
Endian-aware read Read the least significant Size bytes from Src.
void
writeBytesUnaligned (uint64_t Value , uint8_t *Dst, unsigned Size ) const
Endian-aware write.
virtual Expected < JITSymbolFlags >
getJITSymbolFlags (const SymbolRef &Sym)
Generate JITSymbolFlags from a libObject symbol.
virtual uint64_t
modifyAddressBasedOnFlags (uint64_t Addr, JITSymbolFlags Flags) const
Modify the given target address based on the given symbol flags.
Error
emitCommonSymbols (const ObjectFile &Obj, CommonSymbolList &CommonSymbols, uint64_t CommonSize, uint32_t CommonAlign)
Given the common symbols discovered in the object file, emit a new section for them and update the symbol mappings in the object and symbol table.
Expected < unsigned >
emitSection (const ObjectFile &Obj, const SectionRef &Section, bool IsCode)
Emits section data from the object file to the MemoryManager.
Expected < unsigned >
findOrEmitSection (const ObjectFile &Obj, const SectionRef &Section, bool IsCode, ObjSectionToIDMap &LocalSections)
Find Section in LocalSections.
void
addRelocationForSection (const RelocationEntry &RE, unsigned SectionID)
void
addRelocationForSymbol (const RelocationEntry &RE, StringRef SymbolName)
uint8_t *
createStubFunction (uint8_t *Addr, unsigned AbiVariant=0)
Emits long jump instruction to Addr.
void
resolveRelocationList (const RelocationList &Relocs, uint64_t Value )
Resolves relocations from Relocs list with address from Value .
void
applyExternalSymbolRelocations (const StringMap < JITEvaluatedSymbol > ExternalSymbolMap)
Error
resolveExternalSymbols ()
Resolve relocations to external symbols.
Error
computeTotalAllocSize (const ObjectFile &Obj, uint64_t &CodeSize , Align &CodeAlign, uint64_t &RODataSize, Align &RODataAlign, uint64_t &RWDataSize, Align &RWDataAlign)
unsigned
computeGOTSize (const ObjectFile &Obj)
unsigned
computeSectionStubBufSize (const ObjectFile &Obj, const SectionRef &Section)
Expected < ObjSectionToIDMap >
loadObjectImpl (const object::ObjectFile &Obj)
virtual size_t
getGOTEntrySize ()
virtual void
processNewSymbol (const SymbolRef &ObjSymbol, SymbolTableEntry &Entry)
virtual bool
relocationNeedsGot (const RelocationRef &R) const
virtual bool
relocationNeedsStub (const RelocationRef &R) const
Static Protected Member Functions inherited from llvm::RuntimeDyldCOFF
static constexpr StringRef
getImportSymbolPrefix ()
Protected Attributes inherited from llvm::RuntimeDyldImpl
RuntimeDyld::MemoryManager &
MemMgr
JITSymbolResolver &
Resolver
SectionList
Sections
RTDyldSymbolTable
GlobalSymbolTable
std::unordered_map< unsigned , RelocationList >
Relocations
StringMap < RelocationList >
ExternalSymbolRelocations
Triple::ArchType
Arch
bool
IsTargetLittleEndian
bool
IsMipsO32ABI
bool
IsMipsN32ABI
bool
IsMipsN64ABI
bool
ProcessAllSections
sys::Mutex
lock
NotifyStubEmittedFunction
NotifyStubEmitted
bool
HasError
std::string
ErrorStr
Static Protected Attributes inherited from llvm::RuntimeDyldImpl
static const unsigned
AbsoluteSymbolSection = ~0U
Definition at line 24 of file RuntimeDyldCOFFX86_64.h .
◆ finalizeLoad()◆ generateRelocationStub()Definition at line 151 of file RuntimeDyldCOFFX86_64.h .
References llvm::RelocationValueRef::Addend , llvm::RuntimeDyldImpl::createStubFunction() , llvm::StringRef::data() , llvm::dbgs() , getMaxStubSize() , llvm::COFF::IMAGE_REL_AMD64_ADDR64 , LLVM_DEBUG , llvm::Offset , llvm::RelocationValueRef::Offset , resolveRelocation() , llvm::RelocationValueRef::SectionID , llvm::RuntimeDyldImpl::Sections , and llvm::RelocationValueRef::SymbolName .
Referenced by processRelocationRef() .
◆ getMaxStubSize()
unsigned llvm::RuntimeDyldCOFFX86_64::getMaxStubSize ( ) const
inlineoverridevirtual
◆ getStubAlignment()
Align llvm::RuntimeDyldCOFFX86_64::getStubAlignment ( )
inlineoverridevirtual
◆ processRelocationRef()Parses one or more object file relocations (some object files use relocation pairs) and stores it to Relocations or SymbolRelocations (this depends on the object file type).
Returns
Iterator to the next relocation that needs to be parsed.
Implements llvm::RuntimeDyldImpl .
Definition at line 197 of file RuntimeDyldCOFFX86_64.h .
References llvm::RuntimeDyldImpl::addRelocationForSection() , llvm::RuntimeDyldImpl::addRelocationForSymbol() , assert() , llvm::dbgs() , llvm::RuntimeDyldImpl::findOrEmitSection() , generateRelocationStub() , llvm::RuntimeDyldCOFF::getDLLImportOffset() , llvm::RuntimeDyldCOFF::getImportSymbolPrefix() , llvm::object::RelocationRef::getOffset() , llvm::object::RelocationRef::getSymbol() , llvm::RuntimeDyldCOFF::getSymbolOffset() , llvm::object::RelocationRef::getType() , llvm::COFF::IMAGE_REL_AMD64_ADDR32NB , llvm::COFF::IMAGE_REL_AMD64_ADDR64 , llvm::COFF::IMAGE_REL_AMD64_REL32 , llvm::COFF::IMAGE_REL_AMD64_REL32_1 , llvm::COFF::IMAGE_REL_AMD64_REL32_2 , llvm::COFF::IMAGE_REL_AMD64_REL32_3 , llvm::COFF::IMAGE_REL_AMD64_REL32_4 , llvm::COFF::IMAGE_REL_AMD64_REL32_5 , llvm::object::SectionRef::isText() , LLVM_DEBUG , llvm::Offset , llvm::RuntimeDyldImpl::readBytesUnaligned() , llvm::report_fatal_error() , llvm::RuntimeDyldImpl::Sections , llvm::StringRef::starts_with() , and llvm::Expected< T >::takeError() .
◆ registerEHFrames()
void llvm::RuntimeDyldCOFFX86_64::registerEHFrames ( )
inlineoverridevirtual
◆ resolveRelocation()A object file specific relocation resolver.
Parameters
RE
The relocation to be resolved
Value
Target symbol address to apply the relocation action
Implements llvm::RuntimeDyldImpl .
Definition at line 87 of file RuntimeDyldCOFFX86_64.h .
References llvm::RelocationEntry::Addend , assert() , llvm::COFF::IMAGE_REL_AMD64_ADDR32NB , llvm::COFF::IMAGE_REL_AMD64_ADDR64 , llvm::COFF::IMAGE_REL_AMD64_REL32 , llvm::COFF::IMAGE_REL_AMD64_REL32_1 , llvm::COFF::IMAGE_REL_AMD64_REL32_2 , llvm::COFF::IMAGE_REL_AMD64_REL32_3 , llvm::COFF::IMAGE_REL_AMD64_REL32_4 , llvm::COFF::IMAGE_REL_AMD64_REL32_5 , llvm::COFF::IMAGE_REL_AMD64_SECREL , llvm::COFF::IMAGE_REL_AMD64_SECTION , llvm_unreachable , llvm::RelocationEntry::Offset , llvm::RelocationEntry::RelType , llvm::report_fatal_error() , llvm::RelocationEntry::SectionID , llvm::RuntimeDyldImpl::Sections , and llvm::RuntimeDyldImpl::writeBytesUnaligned() .
Referenced by generateRelocationStub() .
The documentation for this class was generated from the following file: