LLVM API Documentation
#include <RuntimeDyldELF.h>
Public Member Functions | |
RuntimeDyldELF (RTDyldMemoryManager *mm) | |
virtual void | resolveRelocation (const RelocationEntry &RE, uint64_t Value) |
A object file specific relocation resolver. More... | |
virtual void | processRelocationRef (unsigned SectionID, RelocationRef RelI, ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID, const SymbolTableMap &Symbols, StubMap &Stubs) |
Parses the object file relocation and stores it to Relocations or SymbolRelocations (this depends on the object file type). More... | |
virtual bool | isCompatibleFormat (const ObjectBuffer *Buffer) const |
virtual ObjectImage * | createObjectImage (ObjectBuffer *InputBuffer) |
virtual void | registerEHFrames () |
virtual void | deregisterEHFrames () |
virtual void | finalizeLoad (ObjSectionToIDMap &SectionMap) |
virtual | ~RuntimeDyldELF () |
![]() | |
RuntimeDyldImpl (RTDyldMemoryManager *mm) | |
virtual | ~RuntimeDyldImpl () |
ObjectImage * | loadObject (ObjectBuffer *InputBuffer) |
void * | getSymbolAddress (StringRef Name) |
uint64_t | getSymbolLoadAddress (StringRef Name) |
void | resolveRelocations () |
void | reassignSectionAddress (unsigned SectionID, uint64_t Addr) |
void | mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress) |
bool | hasError () |
void | clearError () |
StringRef | getErrorString () |
Additional Inherited Members | |
![]() | |
typedef SmallVector < SectionEntry, 64 > | SectionList |
typedef unsigned | SID |
typedef std::map< SectionRef, unsigned > | ObjSectionToIDMap |
typedef std::pair< unsigned, uintptr_t > | SymbolLoc |
typedef StringMap< SymbolLoc > | SymbolTableMap |
typedef std::pair< unsigned, unsigned > | CommonSymbolInfo |
typedef std::map< SymbolRef, CommonSymbolInfo > | CommonSymbolMap |
typedef SmallVector < RelocationEntry, 64 > | RelocationList |
typedef std::map < RelocationValueRef, uintptr_t > | StubMap |
![]() | |
bool | Error (const Twine &Msg) |
uint64_t | getSectionLoadAddress (unsigned SectionID) |
uint8_t * | getSectionAddress (unsigned SectionID) |
void | writeInt16BE (uint8_t *Addr, uint16_t Value) |
void | writeInt32BE (uint8_t *Addr, uint32_t Value) |
void | writeInt64BE (uint8_t *Addr, uint64_t Value) |
void | emitCommonSymbols (ObjectImage &Obj, const CommonSymbolMap &CommonSymbols, uint64_t TotalSize, SymbolTableMap &SymbolTable) |
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. More... | |
unsigned | emitSection (ObjectImage &Obj, const SectionRef &Section, bool IsCode) |
Emits section data from the object file to the MemoryManager. More... | |
unsigned | findOrEmitSection (ObjectImage &Obj, const SectionRef &Section, bool IsCode, ObjSectionToIDMap &LocalSections) |
Find Section in LocalSections. If the secton is not found - emit it and store in LocalSections. More... | |
void | addRelocationForSection (const RelocationEntry &RE, unsigned SectionID) |
void | addRelocationForSymbol (const RelocationEntry &RE, StringRef SymbolName) |
uint8_t * | createStubFunction (uint8_t *Addr) |
Emits long jump instruction to Addr. More... | |
void | resolveRelocationList (const RelocationList &Relocs, uint64_t Value) |
Resolves relocations from Relocs list with address from Value. More... | |
void | resolveExternalSymbols () |
Resolve relocations to external symbols. More... | |
![]() | |
RTDyldMemoryManager * | MemMgr |
SectionList | Sections |
SymbolTableMap | GlobalSymbolTable |
DenseMap< unsigned, RelocationList > | Relocations |
StringMap< RelocationList > | ExternalSymbolRelocations |
Triple::ArchType | Arch |
bool | IsTargetLittleEndian |
sys::Mutex | lock |
bool | HasError |
std::string | ErrorStr |
Definition at line 34 of file RuntimeDyldELF.h.
|
inline |
Definition at line 132 of file RuntimeDyldELF.h.
|
virtual |
Definition at line 217 of file RuntimeDyldELF.cpp.
|
virtual |
Reimplemented from llvm::RuntimeDyldImpl.
Definition at line 181 of file RuntimeDyldELF.cpp.
References llvm::ELF::EI_CLASS, llvm::ELF::EI_DATA, llvm::ELF::EI_NIDENT, llvm::ELF::ELFCLASS32, llvm::ELF::ELFCLASS64, llvm::ELF::ELFDATA2LSB, llvm::ELF::ELFDATA2MSB, llvm::ObjectBuffer::getBufferSize(), llvm::ObjectBuffer::getBufferStart(), llvm::ObjectBuffer::getMemBuffer(), and llvm_unreachable.
|
virtual |
Reimplemented from llvm::RuntimeDyldImpl.
Definition at line 168 of file RuntimeDyldELF.cpp.
|
virtual |
Reimplemented from llvm::RuntimeDyldImpl.
Definition at line 1363 of file RuntimeDyldELF.cpp.
References llvm::object::SectionRef::getName(), llvm::Intrinsic::memset, and llvm::report_fatal_error().
|
virtual |
Implements llvm::RuntimeDyldImpl.
Definition at line 1401 of file RuntimeDyldELF.cpp.
References llvm::ELF::ElfMagic, llvm::ObjectBuffer::getBufferSize(), llvm::ObjectBuffer::getBufferStart(), llvm::LibFunc::memcmp, and llvm::LibFunc::strlen.
|
virtual |
Parses the object file relocation and stores it to Relocations or SymbolRelocations (this depends on the object file type).
Implements llvm::RuntimeDyldImpl.
Definition at line 850 of file RuntimeDyldELF.cpp.
References llvm::Triple::aarch64, llvm::RelocationValueRef::Addend, llvm::SectionEntry::Address, llvm::Triple::arm, Check(), llvm::StringRef::data(), llvm::dbgs(), DEBUG, llvm::StringRef::empty(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::ObjectImage::end_sections(), llvm::ObjectImage::end_symbols(), llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::object::getELFRelocationAddend(), llvm::object::RelocationRef::getOffset(), llvm::object::RelocationRef::getSymbol(), llvm::object::RelocationRef::getType(), if(), llvm_unreachable, llvm::Triple::mips, llvm::Triple::mipsel, llvm::RelocationValueRef::Offset, llvm::Triple::ppc64, llvm::Triple::ppc64le, llvm::ELF::R_390_64, llvm::ELF::R_390_GOTENT, llvm::ELF::R_390_PC32DBL, llvm::ELF::R_390_PLT32DBL, llvm::ELF::R_AARCH64_CALL26, llvm::ELF::R_AARCH64_JUMP26, llvm::ELF::R_AARCH64_MOVW_UABS_G0_NC, llvm::ELF::R_AARCH64_MOVW_UABS_G1_NC, llvm::ELF::R_AARCH64_MOVW_UABS_G2_NC, llvm::ELF::R_AARCH64_MOVW_UABS_G3, llvm::ELF::R_ARM_CALL, llvm::ELF::R_ARM_JUMP24, llvm::ELF::R_ARM_PC24, llvm::ELF::R_ARM_PRIVATE_0, llvm::ELF::R_MIPS_26, llvm::ELF::R_MIPS_UNUSED1, llvm::ELF::R_MIPS_UNUSED2, llvm::ELF::R_PPC64_ADDR16_HI, llvm::ELF::R_PPC64_ADDR16_HIGHER, llvm::ELF::R_PPC64_ADDR16_HIGHEST, llvm::ELF::R_PPC64_ADDR16_LO, llvm::ELF::R_PPC64_ADDR64, llvm::ELF::R_PPC64_REL24, llvm::ELF::R_X86_64_GOTPCREL, llvm::ELF::R_X86_64_PC32, llvm::ELF::R_X86_64_PLT32, llvm::StringMapEntry< ValueTy >::second, llvm::RelocationValueRef::SectionID, llvm::object::SymbolRef::ST_Data, llvm::object::SymbolRef::ST_Debug, llvm::object::SymbolRef::ST_Unknown, llvm::SectionEntry::StubOffset, llvm::ARMBuildAttrs::Symbol, llvm::RelocationValueRef::SymbolName, llvm::Triple::systemz, and llvm::Triple::x86_64.
|
virtual |
Reimplemented from llvm::RuntimeDyldImpl.
Definition at line 154 of file RuntimeDyldELF.cpp.
|
virtual |
A object file specific relocation resolver.
RE | The relocation to be resolved |
Value | Target symbol address to apply the relocation action |
Implements llvm::RuntimeDyldImpl.
Definition at line 802 of file RuntimeDyldELF.cpp.
References llvm::RelocationEntry::Addend, llvm::RelocationEntry::Offset, llvm::RelocationEntry::RelType, llvm::RelocationEntry::SectionID, and llvm::RelocationEntry::SymOffset.