blob: 4efd18a2e6c57046a6b240bd5e9ff264128c9e5d [file] [log] [blame]
David Majnemer1a666e02015-03-07 20:21:27 +00001//===-- RuntimeDyldCOFF.h - Run-time dynamic linker for MC-JIT ---*- C++ -*-==//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
David Majnemer1a666e02015-03-07 20:21:27 +00006//
7//===----------------------------------------------------------------------===//
8//
9// COFF support for MC-JIT runtime dynamic linker.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_RUNTIME_DYLD_COFF_H
14#define LLVM_RUNTIME_DYLD_COFF_H
15
16#include "RuntimeDyldImpl.h"
David Majnemer1a666e02015-03-07 20:21:27 +000017
18#define DEBUG_TYPE "dyld"
19
20using namespace llvm;
21
22namespace llvm {
23
24// Common base class for COFF dynamic linker support.
25// Concrete subclasses for each target can be found in ./Targets.
26class RuntimeDyldCOFF : public RuntimeDyldImpl {
27
28public:
29 std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
30 loadObject(const object::ObjectFile &Obj) override;
31 bool isCompatibleFile(const object::ObjectFile &Obj) const override;
Lang Hames633fe142015-03-30 03:37:06 +000032
33 static std::unique_ptr<RuntimeDyldCOFF>
34 create(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MemMgr,
Lang Hamesad4a9112016-08-01 20:49:11 +000035 JITSymbolResolver &Resolver);
David Majnemer1a666e02015-03-07 20:21:27 +000036
37protected:
Lang Hames633fe142015-03-30 03:37:06 +000038 RuntimeDyldCOFF(RuntimeDyld::MemoryManager &MemMgr,
Lang Hamesad4a9112016-08-01 20:49:11 +000039 JITSymbolResolver &Resolver)
Lang Hames633fe142015-03-30 03:37:06 +000040 : RuntimeDyldImpl(MemMgr, Resolver) {}
David Majnemer1a666e02015-03-07 20:21:27 +000041 uint64_t getSymbolOffset(const SymbolRef &Sym);
42};
43
44} // end namespace llvm
45
46#undef DEBUG_TYPE
47
48#endif