LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::RuntimeDyldELF Class Reference

#include <RuntimeDyldELF.h>

Inheritance diagram for llvm::RuntimeDyldELF:
Inheritance graph
[legend]
Collaboration diagram for llvm::RuntimeDyldELF:
Collaboration graph
[legend]

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 ObjectImagecreateObjectImage (ObjectBuffer *InputBuffer)
 
virtual void registerEHFrames ()
 
virtual void deregisterEHFrames ()
 
virtual void finalizeLoad (ObjSectionToIDMap &SectionMap)
 
virtual ~RuntimeDyldELF ()
 
- Public Member Functions inherited from llvm::RuntimeDyldImpl
 RuntimeDyldImpl (RTDyldMemoryManager *mm)
 
virtual ~RuntimeDyldImpl ()
 
ObjectImageloadObject (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

- Protected Types inherited from llvm::RuntimeDyldImpl
typedef SmallVector
< SectionEntry, 64 > 
SectionList
 
typedef unsigned SID
 
typedef std::map< SectionRef,
unsigned
ObjSectionToIDMap
 
typedef std::pair< unsigned,
uintptr_t > 
SymbolLoc
 
typedef StringMap< SymbolLocSymbolTableMap
 
typedef std::pair< unsigned,
unsigned
CommonSymbolInfo
 
typedef std::map< SymbolRef,
CommonSymbolInfo
CommonSymbolMap
 
typedef SmallVector
< RelocationEntry, 64 > 
RelocationList
 
typedef std::map
< RelocationValueRef,
uintptr_t > 
StubMap
 
- Protected Member Functions inherited from llvm::RuntimeDyldImpl
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...
 
- Protected Attributes inherited from llvm::RuntimeDyldImpl
RTDyldMemoryManagerMemMgr
 
SectionList Sections
 
SymbolTableMap GlobalSymbolTable
 
DenseMap< unsigned,
RelocationList
Relocations
 
StringMap< RelocationListExternalSymbolRelocations
 
Triple::ArchType Arch
 
bool IsTargetLittleEndian
 
sys::Mutex lock
 
bool HasError
 
std::string ErrorStr
 

Detailed Description

Definition at line 34 of file RuntimeDyldELF.h.

Constructor & Destructor Documentation

llvm::RuntimeDyldELF::RuntimeDyldELF ( RTDyldMemoryManager mm)
inline

Definition at line 132 of file RuntimeDyldELF.h.

llvm::RuntimeDyldELF::~RuntimeDyldELF ( )
virtual

Definition at line 217 of file RuntimeDyldELF.cpp.

Member Function Documentation

ObjectImage * llvm::RuntimeDyldELF::createObjectImage ( ObjectBuffer InputBuffer)
virtual
void llvm::RuntimeDyldELF::deregisterEHFrames ( )
virtual

Reimplemented from llvm::RuntimeDyldImpl.

Definition at line 168 of file RuntimeDyldELF.cpp.

void llvm::RuntimeDyldELF::finalizeLoad ( ObjSectionToIDMap SectionMap)
virtual
bool llvm::RuntimeDyldELF::isCompatibleFormat ( const ObjectBuffer Buffer) const
virtual
void llvm::RuntimeDyldELF::processRelocationRef ( unsigned  SectionID,
RelocationRef  RelI,
ObjectImage Obj,
ObjSectionToIDMap ObjSectionToID,
const SymbolTableMap Symbols,
StubMap Stubs 
)
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.

void llvm::RuntimeDyldELF::registerEHFrames ( )
virtual

Reimplemented from llvm::RuntimeDyldImpl.

Definition at line 154 of file RuntimeDyldELF.cpp.

void llvm::RuntimeDyldELF::resolveRelocation ( const RelocationEntry RE,
uint64_t  Value 
)
virtual

A object file specific relocation resolver.

Parameters
REThe relocation to be resolved
ValueTarget 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.


The documentation for this class was generated from the following files: