Path: blob/main/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h
35269 views
//===-- RuntimeDyldCOFF.h - Run-time dynamic linker for MC-JIT ---*- C++ -*-==//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// COFF support for MC-JIT runtime dynamic linker.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_RUNTIME_DYLD_COFF_H13#define LLVM_RUNTIME_DYLD_COFF_H1415#include "RuntimeDyldImpl.h"1617#define DEBUG_TYPE "dyld"1819using namespace llvm;2021namespace llvm {2223// Common base class for COFF dynamic linker support.24// Concrete subclasses for each target can be found in ./Targets.25class RuntimeDyldCOFF : public RuntimeDyldImpl {2627public:28std::unique_ptr<RuntimeDyld::LoadedObjectInfo>29loadObject(const object::ObjectFile &Obj) override;30bool isCompatibleFile(const object::ObjectFile &Obj) const override;3132static std::unique_ptr<RuntimeDyldCOFF>33create(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MemMgr,34JITSymbolResolver &Resolver);3536protected:37RuntimeDyldCOFF(RuntimeDyld::MemoryManager &MemMgr,38JITSymbolResolver &Resolver, unsigned PointerSize,39uint32_t PointerReloc)40: RuntimeDyldImpl(MemMgr, Resolver), PointerSize(PointerSize),41PointerReloc(PointerReloc) {42assert((PointerSize == 4 || PointerSize == 8) && "Unexpected pointer size");43}4445uint64_t getSymbolOffset(const SymbolRef &Sym);46uint64_t getDLLImportOffset(unsigned SectionID, StubMap &Stubs,47StringRef Name, bool SetSectionIDMinus1 = false);4849static constexpr StringRef getImportSymbolPrefix() { return "__imp_"; }5051private:52unsigned PointerSize;53uint32_t PointerReloc;54};5556} // end namespace llvm5758#undef DEBUG_TYPE5960#endif616263