1 //===-- RuntimeDyldELFMips.h ---- ELF/Mips specific code. -------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
10 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
12 #include "../RuntimeDyldELF.h"
14 #define DEBUG_TYPE "dyld"
18 class RuntimeDyldELFMips
: public RuntimeDyldELF
{
21 typedef uint64_t TargetPtrT
;
23 RuntimeDyldELFMips(RuntimeDyld::MemoryManager
&MM
,
24 JITSymbolResolver
&Resolver
)
25 : RuntimeDyldELF(MM
, Resolver
) {}
27 void resolveRelocation(const RelocationEntry
&RE
, uint64_t Value
) override
;
30 void resolveMIPSO32Relocation(const SectionEntry
&Section
, uint64_t Offset
,
31 uint32_t Value
, uint32_t Type
, int32_t Addend
);
32 void resolveMIPSN32Relocation(const SectionEntry
&Section
, uint64_t Offset
,
33 uint64_t Value
, uint32_t Type
, int64_t Addend
,
34 uint64_t SymOffset
, SID SectionID
);
35 void resolveMIPSN64Relocation(const SectionEntry
&Section
, uint64_t Offset
,
36 uint64_t Value
, uint32_t Type
, int64_t Addend
,
37 uint64_t SymOffset
, SID SectionID
);
40 /// A object file specific relocation resolver
41 /// \param RE The relocation to be resolved
42 /// \param Value Target symbol address to apply the relocation action
43 uint64_t evaluateRelocation(const RelocationEntry
&RE
, uint64_t Value
,
46 /// A object file specific relocation resolver
47 /// \param RE The relocation to be resolved
48 /// \param Value Target symbol address to apply the relocation action
49 void applyRelocation(const RelocationEntry
&RE
, uint64_t Value
);
51 int64_t evaluateMIPS32Relocation(const SectionEntry
&Section
, uint64_t Offset
,
52 uint64_t Value
, uint32_t Type
);
53 int64_t evaluateMIPS64Relocation(const SectionEntry
&Section
,
54 uint64_t Offset
, uint64_t Value
,
55 uint32_t Type
, int64_t Addend
,
56 uint64_t SymOffset
, SID SectionID
);
58 void applyMIPSRelocation(uint8_t *TargetPtr
, int64_t CalculatedValue
,