class RuntimeDyldELF

Declaration

class RuntimeDyldELF : public RuntimeDyldImpl { /* full declaration omitted */ };

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:26

Inherits from: RuntimeDyldImpl

Member Variables

private unsigned int GOTSectionID
private unsigned int CurrentGOTIndex
protected DenseMap<llvm::RuntimeDyldImpl::SID, llvm::RuntimeDyldImpl::SID> SectionToGOTMap
private StringMap<uint64_t> GOTSymbolOffsets
private SmallVector<std::pair<RelocationValueRef, RelocationEntry>, 8> PendingRelocs
private SmallVector<llvm::RuntimeDyldImpl::SID, 2> UnregisteredEHFrameSections
private std::map<RelocationValueRef, uint64_t> GOTOffsetMap

Inherited from RuntimeDyldImpl:

protected MemMgr
protected Resolver
protected Sections
protected GlobalSymbolTable
protected Relocations
protected ExternalSymbolRelocations
protected Arch
protected IsTargetLittleEndian
protected IsMipsO32ABI
protected IsMipsN32ABI
protected IsMipsN64ABI
protected ProcessAllSections
protected lock
protected NotifyStubEmitted
protected HasError
protected ErrorStr
protected static AbsoluteSymbolSection = ~0U

Method Overview

  • public RuntimeDyldELF(RuntimeDyld::MemoryManager & MemMgr, llvm::JITSymbolResolver & Resolver)
  • private uint64_t allocateGOTEntries(unsigned int no)
  • private llvm::RelocationEntry computeGOTOffsetRE(uint64_t GOTOffset, uint64_t SymbolOffset, unsigned int Type)
  • private void * computePlaceholderAddress(unsigned int SectionID, uint64_t Offset) const
  • public static std::unique_ptr<RuntimeDyldELF> create(Triple::ArchType Arch, RuntimeDyld::MemoryManager & MemMgr, llvm::JITSymbolResolver & Resolver)
  • public llvm::Error finalizeLoad(const llvm::object::ObjectFile & Obj, llvm::RuntimeDyldImpl::ObjSectionToIDMap & SectionMap)
  • private llvm::Error findOPDEntrySection(const object::ELFObjectFileBase & Obj, llvm::RuntimeDyldImpl::ObjSectionToIDMap & LocalSections, llvm::RelocationValueRef & Rel)
  • private uint64_t findOrAllocGOTEntry(const llvm::RelocationValueRef & Value, unsigned int GOTRelType)
  • private llvm::Error findPPC64TOCSection(const object::ELFObjectFileBase & Obj, llvm::RuntimeDyldImpl::ObjSectionToIDMap & LocalSections, llvm::RelocationValueRef & Rel)
  • protected size_t getGOTEntrySize()
  • private uint32_t getMatchingLoRelocation(uint32_t RelType, bool IsLocal = false) const
  • private unsigned int getMaxStubSize() const
  • private llvm::SectionEntry & getSection(unsigned int SectionID)
  • private unsigned int getStubAlignment()
  • public bool isCompatibleFile(const object::ObjectFile & Obj) const
  • public std::unique_ptr<RuntimeDyld::LoadedObjectInfo> loadObject(const object::ObjectFile & O)
  • public Expected<llvm::object::relocation_iterator> processRelocationRef(unsigned int SectionID, llvm::object::relocation_iterator RelI, const llvm::object::ObjectFile & Obj, llvm::RuntimeDyldImpl::ObjSectionToIDMap & ObjSectionToID, llvm::RuntimeDyldImpl::StubMap & Stubs)
  • private void processSimpleRelocation(unsigned int SectionID, uint64_t Offset, unsigned int RelType, llvm::RelocationValueRef Value)
  • private void processX86_64GOTTPOFFRelocation(unsigned int SectionID, uint64_t Offset, llvm::RelocationValueRef Value, int64_t Addend)
  • private void processX86_64TLSRelocation(unsigned int SectionID, uint64_t Offset, uint64_t RelType, llvm::RelocationValueRef Value, int64_t Addend, const llvm::object::RelocationRef & GetAddrRelocation)
  • public void registerEHFrames()
  • private bool relocationNeedsGot(const llvm::object::RelocationRef & R) const
  • private bool relocationNeedsStub(const llvm::object::RelocationRef & R) const
  • private void resolveAArch64Branch(unsigned int SectionID, const llvm::RelocationValueRef & Value, llvm::object::relocation_iterator RelI, llvm::RuntimeDyldImpl::StubMap & Stubs)
  • private void resolveAArch64Relocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend)
  • private bool resolveAArch64ShortBranch(unsigned int SectionID, llvm::object::relocation_iterator RelI, const llvm::RelocationValueRef & Value)
  • private void resolveARMRelocation(const llvm::SectionEntry & Section, uint64_t Offset, uint32_t Value, uint32_t Type, int32_t Addend)
  • private void resolveBPFRelocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend)
  • private void resolveGOTOffsetRelocation(unsigned int SectionID, uint64_t Offset, uint64_t GOTOffset, uint32_t Type)
  • private void resolvePPC32Relocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend)
  • private void resolvePPC64Relocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend)
  • private void resolveRelocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend, uint64_t SymOffset = 0, llvm::RuntimeDyldImpl::SID SectionID = 0)
  • public void resolveRelocation(const llvm::RelocationEntry & RE, uint64_t Value)
  • private void resolveSystemZRelocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend)
  • private void resolveX86Relocation(const llvm::SectionEntry & Section, uint64_t Offset, uint32_t Value, uint32_t Type, int32_t Addend)
  • private void resolveX86_64Relocation(const llvm::SectionEntry & Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend, uint64_t SymOffset)
  • private void setMipsABI(const llvm::object::ObjectFile & Obj)
  • public ~RuntimeDyldELF()

Inherited from RuntimeDyldImpl:

Methods

RuntimeDyldELF(RuntimeDyld::MemoryManager& MemMgr,
               llvm::JITSymbolResolver& Resolver)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:177

Parameters

RuntimeDyld::MemoryManager& MemMgr
llvm::JITSymbolResolver& Resolver

uint64_t allocateGOTEntries(unsigned int no)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:105

Parameters

unsigned int no

llvm::RelocationEntry computeGOTOffsetRE(
    uint64_t GOTOffset,
    uint64_t SymbolOffset,
    unsigned int Type)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:118

Parameters

uint64_t GOTOffset
uint64_t SymbolOffset
unsigned int Type

void* computePlaceholderAddress(
    unsigned int SectionID,
    uint64_t Offset) const

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:122

Parameters

unsigned int SectionID
uint64_t Offset

static std::unique_ptr<RuntimeDyldELF> create(
    Triple::ArchType Arch,
    RuntimeDyld::MemoryManager& MemMgr,
    llvm::JITSymbolResolver& Resolver)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:182

Parameters

Triple::ArchType Arch
RuntimeDyld::MemoryManager& MemMgr
llvm::JITSymbolResolver& Resolver

llvm::Error finalizeLoad(
    const llvm::object::ObjectFile& Obj,
    llvm::RuntimeDyldImpl::ObjSectionToIDMap&
        SectionMap)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:196

Parameters

const llvm::object::ObjectFile& Obj
llvm::RuntimeDyldImpl::ObjSectionToIDMap& SectionMap

llvm::Error findOPDEntrySection(
    const object::ELFObjectFileBase& Obj,
    llvm::RuntimeDyldImpl::ObjSectionToIDMap&
        LocalSections,
    llvm::RelocationValueRef& Rel)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:94

Parameters

const object::ELFObjectFileBase& Obj
llvm::RuntimeDyldImpl::ObjSectionToIDMap& LocalSections
llvm::RelocationValueRef& Rel

uint64_t findOrAllocGOTEntry(
    const llvm::RelocationValueRef& Value,
    unsigned int GOTRelType)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:108

Parameters

const llvm::RelocationValueRef& Value
unsigned int GOTRelType

llvm::Error findPPC64TOCSection(
    const object::ELFObjectFileBase& Obj,
    llvm::RuntimeDyldImpl::ObjSectionToIDMap&
        LocalSections,
    llvm::RelocationValueRef& Rel)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:91

Parameters

const object::ELFObjectFileBase& Obj
llvm::RuntimeDyldImpl::ObjSectionToIDMap& LocalSections
llvm::RelocationValueRef& Rel

size_t getGOTEntrySize()

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:99

uint32_t getMatchingLoRelocation(
    uint32_t RelType,
    bool IsLocal = false) const

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:129

Parameters

uint32_t RelType
bool IsLocal = false

unsigned int getMaxStubSize() const

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:63

llvm::SectionEntry& getSection(
    unsigned int SectionID)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:102

Parameters

unsigned int SectionID

unsigned int getStubAlignment()

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:82

bool isCompatibleFile(
    const object::ObjectFile& Obj) const

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:194

Parameters

const object::ObjectFile& Obj

std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
loadObject(const object::ObjectFile& O)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:186

Parameters

const object::ObjectFile& O

Expected<llvm::object::relocation_iterator>
processRelocationRef(
    unsigned int SectionID,
    llvm::object::relocation_iterator RelI,
    const llvm::object::ObjectFile& Obj,
    llvm::RuntimeDyldImpl::ObjSectionToIDMap&
        ObjSectionToID,
    llvm::RuntimeDyldImpl::StubMap& Stubs)

Description

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).

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:190

Parameters

unsigned int SectionID
llvm::object::relocation_iterator RelI
const llvm::object::ObjectFile& Obj
llvm::RuntimeDyldImpl::ObjSectionToIDMap& ObjSectionToID
llvm::RuntimeDyldImpl::StubMap& Stubs

Returns

Iterator to the next relocation that needs to be parsed.

void processSimpleRelocation(
    unsigned int SectionID,
    uint64_t Offset,
    unsigned int RelType,
    llvm::RelocationValueRef Value)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:126

Parameters

unsigned int SectionID
uint64_t Offset
unsigned int RelType
llvm::RelocationValueRef Value

void processX86_64GOTTPOFFRelocation(
    unsigned int SectionID,
    uint64_t Offset,
    llvm::RelocationValueRef Value,
    int64_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:166

Parameters

unsigned int SectionID
uint64_t Offset
llvm::RelocationValueRef Value
int64_t Addend

void processX86_64TLSRelocation(
    unsigned int SectionID,
    uint64_t Offset,
    uint64_t RelType,
    llvm::RelocationValueRef Value,
    int64_t Addend,
    const llvm::object::RelocationRef&
        GetAddrRelocation)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:171

Parameters

unsigned int SectionID
uint64_t Offset
uint64_t RelType
llvm::RelocationValueRef Value
int64_t Addend
const llvm::object::RelocationRef& GetAddrRelocation

void registerEHFrames()

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:195

bool relocationNeedsGot(
    const llvm::object::RelocationRef& R) const

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:161

Parameters

const llvm::object::RelocationRef& R

bool relocationNeedsStub(
    const llvm::object::RelocationRef& R) const

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:162

Parameters

const llvm::object::RelocationRef& R

void resolveAArch64Branch(
    unsigned int SectionID,
    const llvm::RelocationValueRef& Value,
    llvm::object::relocation_iterator RelI,
    llvm::RuntimeDyldImpl::StubMap& Stubs)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:45

Parameters

unsigned int SectionID
const llvm::RelocationValueRef& Value
llvm::object::relocation_iterator RelI
llvm::RuntimeDyldImpl::StubMap& Stubs

void resolveAArch64Relocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:39

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend

bool resolveAArch64ShortBranch(
    unsigned int SectionID,
    llvm::object::relocation_iterator RelI,
    const llvm::RelocationValueRef& Value)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:42

Parameters

unsigned int SectionID
llvm::object::relocation_iterator RelI
const llvm::RelocationValueRef& Value

void resolveARMRelocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint32_t Value,
    uint32_t Type,
    int32_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:48

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint32_t Value
uint32_t Type
int32_t Addend

void resolveBPFRelocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:60

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend

void resolveGOTOffsetRelocation(
    unsigned int SectionID,
    uint64_t Offset,
    uint64_t GOTOffset,
    uint32_t Type)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:113

Parameters

unsigned int SectionID
uint64_t Offset
uint64_t GOTOffset
uint32_t Type

void resolvePPC32Relocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:51

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend

void resolvePPC64Relocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:54

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend

void resolveRelocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend,
    uint64_t SymOffset = 0,
    llvm::RuntimeDyldImpl::SID SectionID = 0)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:28

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend
uint64_t SymOffset = 0
llvm::RuntimeDyldImpl::SID SectionID = 0

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

Description

A object file specific relocation resolver

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:188

Parameters

const llvm::RelocationEntry& RE
The relocation to be resolved
uint64_t Value
Target symbol address to apply the relocation action

void resolveSystemZRelocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:57

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend

void resolveX86Relocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint32_t Value,
    uint32_t Type,
    int32_t Addend)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:36

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint32_t Value
uint32_t Type
int32_t Addend

void resolveX86_64Relocation(
    const llvm::SectionEntry& Section,
    uint64_t Offset,
    uint64_t Value,
    uint32_t Type,
    int64_t Addend,
    uint64_t SymOffset)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:32

Parameters

const llvm::SectionEntry& Section
uint64_t Offset
uint64_t Value
uint32_t Type
int64_t Addend
uint64_t SymOffset

void setMipsABI(
    const llvm::object::ObjectFile& Obj)

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:89

Parameters

const llvm::object::ObjectFile& Obj

~RuntimeDyldELF()

Declared at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h:179