blob: 3011a06537dc4ef12b6ec33be0126cd04d146df5 [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
Akira Hatanakab889e0c2012-08-17 21:28:04 +000043 void resolveMIPSRelocation(uint8_t *LocalAddress,
Akira Hatanakab862f092012-08-20 17:53:24 +000044 uint32_t FinalAddress,
45 uint32_t Value,
46 uint32_t Type,
47 int32_t Addend);
Akira Hatanakab889e0c2012-08-17 21:28:04 +000048
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000049 virtual void resolveRelocation(uint8_t *LocalAddress,
50 uint64_t FinalAddress,
51 uint64_t Value,
52 uint32_t Type,
53 int64_t Addend);
Eli Bendersky76463fd2012-01-22 07:05:02 +000054
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000055 virtual void processRelocationRef(const ObjRelocationInfo &Rel,
Preston Gurd689ff9c2012-04-16 22:12:58 +000056 ObjectImage &Obj,
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000057 ObjSectionToIDMap &ObjSectionToID,
Eli Benderskyd98c9e92012-05-01 06:58:59 +000058 const SymbolTableMap &Symbols,
59 StubMap &Stubs);
Eli Bendersky76463fd2012-01-22 07:05:02 +000060
Andrew Kaylor3f23cef2012-10-02 21:18:39 +000061 virtual ObjectImage *createObjectImage(ObjectBuffer *InputBuffer);
Preston Gurd689ff9c2012-04-16 22:12:58 +000062
Eli Bendersky76463fd2012-01-22 07:05:02 +000063public:
Preston Gurd689ff9c2012-04-16 22:12:58 +000064 RuntimeDyldELF(RTDyldMemoryManager *mm)
Andrew Kaylor3f23cef2012-10-02 21:18:39 +000065 : RuntimeDyldImpl(mm) {}
Preston Gurd689ff9c2012-04-16 22:12:58 +000066
67 virtual ~RuntimeDyldELF();
Eli Bendersky76463fd2012-01-22 07:05:02 +000068
Andrew Kaylor3f23cef2012-10-02 21:18:39 +000069 bool isCompatibleFormat(const ObjectBuffer *Buffer) const;
Eli Bendersky76463fd2012-01-22 07:05:02 +000070};
71
72} // end namespace llvm
73
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000074#endif