13#ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_RUNTIMEDYLDMACHO_H
14#define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_RUNTIMEDYLDMACHO_H
81 bool TargetIsLocalThumbFunc =
false);
101 unsigned OffsetToNextPC);
114 unsigned PTSectionID);
119 static std::unique_ptr<RuntimeDyldMachO>
124 std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
139template <
typename Impl>
142 Impl &impl() {
return static_cast<Impl &
>(*this); }
143 const Impl &impl()
const {
return static_cast<const Impl &
>(*this); }
145 unsigned char *processFDE(
uint8_t *
P, int64_t DeltaForText,
#define RTDYLD_INVALID_SECTION_ID
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Symbol resolution interface.
RelocationEntry - used to represent relocations internally in the dynamic linker.
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
std::map< SectionRef, unsigned > ObjSectionToIDMap
RuntimeDyld::MemoryManager & MemMgr
RuntimeDyldMachOTarget - Templated base class for generic MachO linker algorithms and data structures...
void registerEHFrames() override
RuntimeDyldMachOCRTPBase(RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver)
Error finalizeLoad(const ObjectFile &Obj, ObjSectionToIDMap &SectionMap) override
RuntimeDyldMachO(RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver)
static std::unique_ptr< RuntimeDyldMachO > create(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver)
Create a RuntimeDyldMachO instance for the given target architecture.
static section_iterator getSectionByAddress(const MachOObjectFile &Obj, uint64_t Addr)
int64_t memcpyAddend(const RelocationEntry &RE) const
This convenience method uses memcpy to extract a contiguous addend (the addend size and offset are ta...
SmallVector< EHFrameRelatedSections, 2 > UnregisteredEHFrameSections
std::unique_ptr< RuntimeDyld::LoadedObjectInfo > loadObject(const object::ObjectFile &O) override
SectionEntry & getSection(unsigned SectionID)
Error populateIndirectSymbolPointersSection(const MachOObjectFile &Obj, const SectionRef &PTSection, unsigned PTSectionID)
void makeValueAddendPCRel(RelocationValueRef &Value, const relocation_iterator &RI, unsigned OffsetToNextPC)
Make the RelocationValueRef addend PC-relative.
RelocationEntry getRelocationEntry(unsigned SectionID, const ObjectFile &BaseTObj, const relocation_iterator &RI) const
Given a relocation_iterator for a non-scattered relocation, construct a RelocationEntry and fill in t...
Expected< RelocationValueRef > getRelocationValueRef(const ObjectFile &BaseTObj, const relocation_iterator &RI, const RelocationEntry &RE, ObjSectionToIDMap &ObjSectionToID)
Construct a RelocationValueRef representing the relocation target.
Expected< relocation_iterator > processScatteredVANILLA(unsigned SectionID, relocation_iterator RelI, const ObjectFile &BaseObjT, RuntimeDyldMachO::ObjSectionToIDMap &ObjSectionToID, bool TargetIsLocalThumbFunc=false)
Process a scattered vanilla relocation.
bool isCompatibleFile(const object::ObjectFile &Obj) const override
void dumpRelocationToResolve(const RelocationEntry &RE, uint64_t Value) const
Dump information about the relocation entry (RE) and resolved value.
SectionEntry - represents a section emitted into memory by the dynamic linker.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM Value Representation.
unsigned getAnyRelocationType(const MachO::any_relocation_info &RE) const
unsigned getAnyRelocationPCRel(const MachO::any_relocation_info &RE) const
unsigned getAnyRelocationLength(const MachO::any_relocation_info &RE) const
MachO::any_relocation_info getRelocation(DataRefImpl Rel) const
This class is the base class for all object file types.
This is a value type class that represents a single section in the list of sections in the object fil...
This is an optimization pass for GlobalISel generic memory operations.