1 //===-- RuntimeDyldELF.h - Run-time dynamic linker for MC-JIT ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // ELF support for MC-JIT runtime dynamic linker.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_RUNTIME_DYLD_ELF_H
15 #define LLVM_RUNTIME_DYLD_ELF_H
17 #include "RuntimeDyldImpl.h"
24 // Helper for extensive error checking in debug builds.
25 error_code Check(error_code Err) {
27 report_fatal_error(Err.message());
31 } // end anonymous namespace
33 class RuntimeDyldELF : public RuntimeDyldImpl {
35 void resolveX86_64Relocation(uint8_t *LocalAddress,
36 uint64_t FinalAddress,
41 void resolveX86Relocation(uint8_t *LocalAddress,
42 uint32_t FinalAddress,
47 void resolveARMRelocation(uint8_t *LocalAddress,
48 uint32_t FinalAddress,
53 void resolveMIPSRelocation(uint8_t *LocalAddress,
54 uint32_t FinalAddress,
59 void resolvePPC64Relocation(uint8_t *LocalAddress,
60 uint64_t FinalAddress,
65 virtual void resolveRelocation(uint8_t *LocalAddress,
66 uint64_t FinalAddress,
71 virtual void processRelocationRef(const ObjRelocationInfo &Rel,
73 ObjSectionToIDMap &ObjSectionToID,
74 const SymbolTableMap &Symbols,
77 unsigned getCommonSymbolAlignment(const SymbolRef &Sym);
79 virtual ObjectImage *createObjectImage(ObjectBuffer *InputBuffer);
81 uint64_t findPPC64TOC() const;
82 void findOPDEntrySection(ObjectImage &Obj,
83 ObjSectionToIDMap &LocalSections,
84 RelocationValueRef &Rel);
87 RuntimeDyldELF(RTDyldMemoryManager *mm)
88 : RuntimeDyldImpl(mm) {}
90 virtual ~RuntimeDyldELF();
92 bool isCompatibleFormat(const ObjectBuffer *Buffer) const;
95 } // end namespace llvm