14 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_RUNTIMEDYLDELF_H
15 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_RUNTIMEDYLDELF_H
31 uint64_t SymOffset = 0,
SID SectionID = 0);
33 void resolveX86_64Relocation(
const SectionEntry &Section, uint64_t Offset,
34 uint64_t Value,
uint32_t Type, int64_t Addend,
37 void resolveX86Relocation(
const SectionEntry &Section, uint64_t Offset,
40 void resolveAArch64Relocation(
const SectionEntry &Section, uint64_t Offset,
41 uint64_t Value,
uint32_t Type, int64_t Addend);
49 void resolveARMRelocation(
const SectionEntry &Section, uint64_t Offset,
52 void resolvePPC32Relocation(
const SectionEntry &Section, uint64_t Offset,
53 uint64_t Value,
uint32_t Type, int64_t Addend);
55 void resolvePPC64Relocation(
const SectionEntry &Section, uint64_t Offset,
56 uint64_t Value,
uint32_t Type, int64_t Addend);
58 void resolveSystemZRelocation(
const SectionEntry &Section, uint64_t Offset,
59 uint64_t Value,
uint32_t Type, int64_t Addend);
61 void resolveBPFRelocation(
const SectionEntry &Section, uint64_t Offset,
62 uint64_t Value,
uint32_t Type, int64_t Addend);
64 unsigned getMaxStubSize()
override {
81 unsigned getStubAlignment()
override {
88 void setMipsABI(
const ObjectFile &Obj)
override;
103 uint64_t allocateGOTEntries(
unsigned no);
107 unsigned GOTRelType);
111 void resolveGOTOffsetRelocation(
unsigned SectionID, uint64_t Offset,
116 RelocationEntry computeGOTOffsetRE(uint64_t GOTOffset, uint64_t SymbolOffset,
120 void *computePlaceholderAddress(
unsigned SectionID, uint64_t Offset)
const;
124 void processSimpleRelocation(
unsigned SectionID, uint64_t Offset,
unsigned RelType,
RelocationValueRef Value);
128 bool IsLocal =
false)
const;
131 unsigned GOTSectionID;
136 unsigned CurrentGOTIndex;
157 std::map<RelocationValueRef, uint64_t> GOTOffsetMap;
159 bool relocationNeedsGot(
const RelocationRef &R)
const override;
160 bool relocationNeedsStub(
const RelocationRef &R)
const override;
167 static std::unique_ptr<RuntimeDyldELF>
171 std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
174 void resolveRelocation(
const RelocationEntry &RE, uint64_t Value)
override;
RelocationEntry - used to represent relocations internally in the dynamic linker. ...
RuntimeDyld::MemoryManager & MemMgr
size_t getGOTEntrySize() override
This class is the base class for all object file types.
static std::unique_ptr< RuntimeDyldELF > create(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver)
This is a value type class that represents a single relocation in the list of relocations in the obje...
std::unique_ptr< RuntimeDyld::LoadedObjectInfo > loadObject(const object::ObjectFile &O) override
std::map< RelocationValueRef, uintptr_t > StubMap
Tagged union holding either a T or a Error.
Expected< relocation_iterator > processRelocationRef(unsigned SectionID, relocation_iterator RelI, const ObjectFile &Obj, ObjSectionToIDMap &ObjSectionToID, StubMap &Stubs) override
Parses one or more object file relocations (some object files use relocation pairs) and stores it to ...
The instances of the Type class are immutable: once they are created, they are never changed...
void registerEHFrames() override
~RuntimeDyldELF() override
bool isCompatibleFile(const object::ObjectFile &Obj) const override
DenseMap< SID, SID > SectionToGOTMap
Error finalizeLoad(const ObjectFile &Obj, ObjSectionToIDMap &SectionMap) override
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
JITSymbolResolver & Resolver
std::map< SectionRef, unsigned > ObjSectionToIDMap
SectionEntry - represents a section emitted into memory by the dynamic linker.
RuntimeDyldELF(RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver)
LLVM Value Representation.
Lightweight error class with error context and mandatory checking.