blob: 36566da57a58b6707a3fa34c12c5ecd8c887b9c2 [file] [log] [blame]
Eli Bendersky76463fd2012-01-22 07:05:02 +00001//===-- RuntimeDyldELF.h - Run-time dynamic linker for MC-JIT ---*- 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// ELF support for MC-JIT runtime dynamic linker.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_RUNTIME_DYLD_ELF_H
15#define LLVM_RUNTIME_DYLD_ELF_H
16
17#include "RuntimeDyldImpl.h"
18
19using namespace llvm;
20
21
22namespace llvm {
23class RuntimeDyldELF : public RuntimeDyldImpl {
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000024protected:
25 void resolveX86_64Relocation(uint8_t *LocalAddress,
26 uint64_t FinalAddress,
27 uint64_t Value,
28 uint32_t Type,
29 int64_t Addend);
Eli Bendersky76463fd2012-01-22 07:05:02 +000030
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000031 void resolveX86Relocation(uint8_t *LocalAddress,
32 uint32_t FinalAddress,
33 uint32_t Value,
34 uint32_t Type,
35 int32_t Addend);
Eli Bendersky76463fd2012-01-22 07:05:02 +000036
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000037 void resolveARMRelocation(uint8_t *LocalAddress,
38 uint32_t FinalAddress,
39 uint32_t Value,
40 uint32_t Type,
41 int32_t Addend);
Eli Bendersky76463fd2012-01-22 07:05:02 +000042
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000043 virtual void resolveRelocation(uint8_t *LocalAddress,
44 uint64_t FinalAddress,
45 uint64_t Value,
46 uint32_t Type,
47 int64_t Addend);
Eli Bendersky76463fd2012-01-22 07:05:02 +000048
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000049 virtual void processRelocationRef(const ObjRelocationInfo &Rel,
50 const ObjectFile &Obj,
51 ObjSectionToIDMap &ObjSectionToID,
52 LocalSymbolMap &Symbols, StubMap &Stubs);
Eli Bendersky76463fd2012-01-22 07:05:02 +000053
54public:
55 RuntimeDyldELF(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
56
Eli Bendersky76463fd2012-01-22 07:05:02 +000057 bool isCompatibleFormat(const MemoryBuffer *InputBuffer) const;
58};
59
60} // end namespace llvm
61
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000062#endif