RuntimeDyldMachO.h revision 235633
1178828Sdfr//===-- RuntimeDyldMachO.h - Run-time dynamic linker for MC-JIT ---*- C++ -*-=//
2178828Sdfr//
3178828Sdfr//                     The LLVM Compiler Infrastructure
4178828Sdfr//
5178828Sdfr// This file is distributed under the University of Illinois Open Source
6178828Sdfr// License. See LICENSE.TXT for details.
7178828Sdfr//
8178828Sdfr//===----------------------------------------------------------------------===//
9178828Sdfr//
10178828Sdfr// MachO support for MC-JIT runtime dynamic linker.
11178828Sdfr//
12178828Sdfr//===----------------------------------------------------------------------===//
13178828Sdfr
14178828Sdfr#ifndef LLVM_RUNTIME_DYLD_MACHO_H
15178828Sdfr#define LLVM_RUNTIME_DYLD_MACHO_H
16178828Sdfr
17178828Sdfr#include "llvm/ADT/IndexedMap.h"
18178828Sdfr#include "llvm/Object/MachOObject.h"
19178828Sdfr#include "llvm/Support/Format.h"
20178828Sdfr#include "RuntimeDyldImpl.h"
21178828Sdfr
22178828Sdfrusing namespace llvm;
23178828Sdfrusing namespace llvm::object;
24178828Sdfr
25178828Sdfr
26178828Sdfrnamespace llvm {
27178828Sdfrclass RuntimeDyldMachO : public RuntimeDyldImpl {
28178828Sdfrprotected:
29178828Sdfr  bool resolveI386Relocation(uint8_t *LocalAddress,
30178828Sdfr                             uint64_t FinalAddress,
31178828Sdfr                             uint64_t Value,
32178828Sdfr                             bool isPCRel,
33178828Sdfr                             unsigned Type,
34178828Sdfr                             unsigned Size,
35178828Sdfr                             int64_t Addend);
36233294Sstas  bool resolveX86_64Relocation(uint8_t *LocalAddress,
37178828Sdfr                               uint64_t FinalAddress,
38178828Sdfr                               uint64_t Value,
39178828Sdfr                               bool isPCRel,
40178828Sdfr                               unsigned Type,
41178828Sdfr                               unsigned Size,
42178828Sdfr                               int64_t Addend);
43178828Sdfr  bool resolveARMRelocation(uint8_t *LocalAddress,
44178828Sdfr                            uint64_t FinalAddress,
45178828Sdfr                            uint64_t Value,
46178828Sdfr                            bool isPCRel,
47178828Sdfr                            unsigned Type,
48178828Sdfr                            unsigned Size,
49178828Sdfr                            int64_t Addend);
50178828Sdfr
51178828Sdfr  virtual void processRelocationRef(const ObjRelocationInfo &Rel,
52178828Sdfr                                    ObjectImage &Obj,
53178828Sdfr                                    ObjSectionToIDMap &ObjSectionToID,
54178828Sdfr                                    LocalSymbolMap &Symbols, StubMap &Stubs);
55178828Sdfr
56178828Sdfrpublic:
57178828Sdfr  virtual void resolveRelocation(uint8_t *LocalAddress,
58178828Sdfr                                 uint64_t FinalAddress,
59178828Sdfr                                 uint64_t Value,
60178828Sdfr                                 uint32_t Type,
61178828Sdfr                                 int64_t Addend);
62178828Sdfr
63178828Sdfr  RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
64178828Sdfr
65178828Sdfr  bool isCompatibleFormat(const MemoryBuffer *InputBuffer) const;
66178828Sdfr};
67178828Sdfr
68178828Sdfr} // end namespace llvm
69178828Sdfr
70178828Sdfr#endif
71178828Sdfr