LLVM 20.0.0git
RuntimeDyldCOFF.h
Go to the documentation of this file.
1//===-- RuntimeDyldCOFF.h - Run-time dynamic linker for MC-JIT ---*- C++ -*-==//
2//
3// 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
6//
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"
17
18namespace llvm {
19
20// Common base class for COFF dynamic linker support.
21// Concrete subclasses for each target can be found in ./Targets.
23
24public:
25 std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
26 loadObject(const object::ObjectFile &Obj) override;
27 bool isCompatibleFile(const object::ObjectFile &Obj) const override;
28
29 static std::unique_ptr<RuntimeDyldCOFF>
32
33protected:
35 JITSymbolResolver &Resolver, unsigned PointerSize,
36 uint32_t PointerReloc)
37 : RuntimeDyldImpl(MemMgr, Resolver), PointerSize(PointerSize),
38 PointerReloc(PointerReloc) {
39 assert((PointerSize == 4 || PointerSize == 8) && "Unexpected pointer size");
40 }
41
43 uint64_t getDLLImportOffset(unsigned SectionID, StubMap &Stubs,
44 StringRef Name, bool SetSectionIDMinus1 = false);
45
46 static constexpr StringRef getImportSymbolPrefix() { return "__imp_"; }
47
48private:
49 unsigned PointerSize;
50 uint32_t PointerReloc;
51};
52
53} // end namespace llvm
54
55#endif // LLVM_RUNTIME_DYLD_COFF_H
std::string Name
Symbol * Sym
Definition: ELF_riscv.cpp:479
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Symbol resolution interface.
Definition: JITSymbol.h:371
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition: Record.h:2212
uint64_t getSymbolOffset(const SymbolRef &Sym)
static constexpr StringRef getImportSymbolPrefix()
RuntimeDyldCOFF(RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver, unsigned PointerSize, uint32_t PointerReloc)
std::unique_ptr< RuntimeDyld::LoadedObjectInfo > loadObject(const object::ObjectFile &Obj) override
static std::unique_ptr< RuntimeDyldCOFF > create(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver)
bool isCompatibleFile(const object::ObjectFile &Obj) const override
uint64_t getDLLImportOffset(unsigned SectionID, StubMap &Stubs, StringRef Name, bool SetSectionIDMinus1=false)
std::map< RelocationValueRef, uintptr_t > StubMap
RuntimeDyld::MemoryManager & MemMgr
Triple::ArchType Arch
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
This class is the base class for all object file types.
Definition: ObjectFile.h:229
This is a value type class that represents a single symbol in the list of symbols in the object file.
Definition: ObjectFile.h:168
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18