1 //===-- RuntimeDyldCOFFX86_64.h --- COFF/X86_64 specific code ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // COFF x86_x64 support for MC-JIT runtime dynamic linker.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDCOFF86_64_H
15 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDCOFF86_64_H
17 #include "llvm/Object/COFF.h"
18 #include "llvm/Support/COFF.h"
19 #include "../RuntimeDyldCOFF.h"
25 class RuntimeDyldCOFFX86_64 : public RuntimeDyldCOFF {
28 // When a module is loaded we save the SectionID of the unwind
29 // sections in a table until we receive a request to register all
30 // unregisteredEH frame sections with the memory manager.
31 SmallVector<SID, 2> UnregisteredEHFrameSections;
32 SmallVector<SID, 2> RegisteredEHFrameSections;
35 RuntimeDyldCOFFX86_64(RTDyldMemoryManager *MM) : RuntimeDyldCOFF(MM) {}
37 unsigned getMaxStubSize() override {
38 return 6; // 2-byte jmp instruction + 32-bit relative address
41 void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
43 relocation_iterator processRelocationRef(unsigned SectionID,
44 relocation_iterator RelI,
45 const ObjectFile &Obj,
46 ObjSectionToIDMap &ObjSectionToID,
47 StubMap &Stubs) override;
49 unsigned getStubAlignment() override { return 1; }
50 void registerEHFrames() override;
51 void deregisterEHFrames() override;
52 void finalizeLoad(const ObjectFile &Obj,
53 ObjSectionToIDMap &SectionMap) override;
56 } // end namespace llvm