1 //===-- RuntimeDyldELFMips.h ---- ELF/Mips specific code. -------*- 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 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
11 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
13 #include "../RuntimeDyldELF.h"
16 #define DEBUG_TYPE "dyld"
20 class RuntimeDyldELFMips : public RuntimeDyldELF {
23 typedef uint64_t TargetPtrT;
25 RuntimeDyldELFMips(RuntimeDyld::MemoryManager &MM,
26 JITSymbolResolver &Resolver)
27 : RuntimeDyldELF(MM, Resolver) {}
29 void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
32 void resolveMIPSO32Relocation(const SectionEntry &Section, uint64_t Offset,
33 uint32_t Value, uint32_t Type, int32_t Addend);
34 void resolveMIPSN32Relocation(const SectionEntry &Section, uint64_t Offset,
35 uint64_t Value, uint32_t Type, int64_t Addend,
36 uint64_t SymOffset, SID SectionID);
37 void resolveMIPSN64Relocation(const SectionEntry &Section, uint64_t Offset,
38 uint64_t Value, uint32_t Type, int64_t Addend,
39 uint64_t SymOffset, SID SectionID);
42 /// A object file specific relocation resolver
43 /// \param RE The relocation to be resolved
44 /// \param Value Target symbol address to apply the relocation action
45 uint64_t evaluateRelocation(const RelocationEntry &RE, uint64_t Value,
48 /// A object file specific relocation resolver
49 /// \param RE The relocation to be resolved
50 /// \param Value Target symbol address to apply the relocation action
51 void applyRelocation(const RelocationEntry &RE, uint64_t Value);
53 int64_t evaluateMIPS32Relocation(const SectionEntry &Section, uint64_t Offset,
54 uint64_t Value, uint32_t Type);
55 int64_t evaluateMIPS64Relocation(const SectionEntry &Section,
56 uint64_t Offset, uint64_t Value,
57 uint32_t Type, int64_t Addend,
58 uint64_t SymOffset, SID SectionID);
60 void applyMIPSRelocation(uint8_t *TargetPtr, int64_t CalculatedValue,