LLVM  8.0.1
RuntimeDyldELFMips.h
Go to the documentation of this file.
1 //===-- RuntimeDyldELFMips.h ---- ELF/Mips specific code. -------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
11 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
12 
13 #include "../RuntimeDyldELF.h"
14 #include <string>
15 
16 #define DEBUG_TYPE "dyld"
17 
18 namespace llvm {
19 
21 public:
22 
23  typedef uint64_t TargetPtrT;
24 
27  : RuntimeDyldELF(MM, Resolver) {}
28 
29  void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
30 
31 protected:
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);
40 
41 private:
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,
46  uint64_t Addend);
47 
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);
52 
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);
59 
60  void applyMIPSRelocation(uint8_t *TargetPtr, int64_t CalculatedValue,
61  uint32_t Type);
62 
63 };
64 }
65 
66 #undef DEBUG_TYPE
67 
68 #endif
RuntimeDyldELFMips(RuntimeDyld::MemoryManager &MM, JITSymbolResolver &Resolver)
RelocationEntry - used to represent relocations internally in the dynamic linker. ...
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override
A object file specific relocation resolver.
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition: Record.h:1774
Symbol resolution interface.
Definition: JITSymbol.h:344
void resolveMIPSN32Relocation(const SectionEntry &Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend, uint64_t SymOffset, SID SectionID)
void resolveMIPSN64Relocation(const SectionEntry &Section, uint64_t Offset, uint64_t Value, uint32_t Type, int64_t Addend, uint64_t SymOffset, SID SectionID)
void resolveMIPSO32Relocation(const SectionEntry &Section, uint64_t Offset, uint32_t Value, uint32_t Type, int32_t Addend)
SectionEntry - represents a section emitted into memory by the dynamic linker.
LLVM Value Representation.
Definition: Value.h:73