LLVM API Documentation
#include <RuntimeDyldMachO.h>
Public Member Functions | |
RuntimeDyldMachO (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 void | registerEHFrames () |
virtual void | finalizeLoad (ObjSectionToIDMap &SectionMap) |
![]() | |
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 () |
virtual void | deregisterEHFrames () |
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... | |
virtual void | updateGOTEntries (StringRef Name, uint64_t Addr) |
Update GOT entries for external symbols. More... | |
virtual ObjectImage * | createObjectImage (ObjectBuffer *InputBuffer) |
![]() | |
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 27 of file RuntimeDyldMachO.h.
|
inline |
Definition at line 87 of file RuntimeDyldMachO.h.
|
virtual |
Reimplemented from llvm::RuntimeDyldImpl.
Definition at line 91 of file RuntimeDyldMachO.cpp.
References llvm::object::SectionRef::getName(), RTDYLD_INVALID_SECTION_ID, and llvm::ARMBuildAttrs::Section.
|
virtual |
Implements llvm::RuntimeDyldImpl.
Definition at line 446 of file RuntimeDyldMachO.cpp.
References llvm::ObjectBuffer::getBufferSize(), llvm::ObjectBuffer::getBufferStart(), and Magic.
|
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 324 of file RuntimeDyldMachO.cpp.
References llvm::RelocationValueRef::Addend, llvm::SectionEntry::Address, llvm::Triple::arm, llvm::MachO::ARM_RELOC_BR24, llvm::StringRef::data(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::MachO::GENERIC_RELOC_VANILLA, llvm::object::SectionRef::getAddress(), llvm::object::MachOObjectFile::getAnyRelocationLength(), llvm::object::MachOObjectFile::getAnyRelocationPCRel(), llvm::object::MachOObjectFile::getAnyRelocationType(), llvm::ObjectImage::getObjectFile(), llvm::object::RelocationRef::getOffset(), llvm::object::MachOObjectFile::getPlainRelocationExternal(), llvm::object::RelocationRef::getRawDataRefImpl(), llvm::object::MachOObjectFile::getRelocation(), llvm::object::MachOObjectFile::getRelocationSection(), llvm::object::RelocationRef::getSymbol(), llvm::object::MachOObjectFile::isRelocationScattered(), llvm::Intrinsic::memcpy, llvm::StringMapEntry< ValueTy >::second, llvm::RelocationValueRef::SectionID, llvm::SectionEntry::StubOffset, llvm::ARMBuildAttrs::Symbol, llvm::RelocationValueRef::SymbolName, llvm::Triple::x86_64, llvm::MachO::X86_64_RELOC_GOT, llvm::MachO::X86_64_RELOC_GOT_LOAD, and llvm::MachO::X86_64_RELOC_UNSIGNED.
|
virtual |
Reimplemented from llvm::RuntimeDyldImpl.
Definition at line 58 of file RuntimeDyldMachO.cpp.
References llvm::SectionEntry::Address, llvm::computeDelta(), llvm::SectionEntry::LoadAddress, P, llvm::processFDE(), RTDYLD_INVALID_SECTION_ID, and llvm::SectionEntry::Size.
|
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 132 of file RuntimeDyldMachO.cpp.
References llvm::RelocationEntry::Addend, llvm::RelocationEntry::IsPCRel, llvm::RelocationEntry::Offset, llvm::RelocationEntry::RelType, llvm::ARMBuildAttrs::Section, llvm::RelocationEntry::SectionID, and llvm::RelocationEntry::Size.