]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / lib / ReaderWriter / ELF / X86_64 / X86_64RelocationHandler.h
1 //===- lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h --------------===//
2 //
3 //                             The LLVM Linker
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef X86_64_RELOCATION_HANDLER_H
11 #define X86_64_RELOCATION_HANDLER_H
12
13 #include "X86_64TargetHandler.h"
14
15 namespace lld {
16 namespace elf {
17 typedef llvm::object::ELFType<llvm::support::little, 2, true> X86_64ELFType;
18
19 class X86_64TargetLayout;
20
21 class X86_64TargetRelocationHandler final : public TargetRelocationHandler {
22 public:
23   X86_64TargetRelocationHandler(X86_64TargetLayout &layout)
24       : _tlsSize(0), _x86_64Layout(layout) {}
25
26   std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
27                                   const lld::AtomLayout &,
28                                   const Reference &) const override;
29
30 private:
31   // Cached size of the TLS segment.
32   mutable uint64_t _tlsSize;
33   X86_64TargetLayout &_x86_64Layout;
34 };
35
36 } // end namespace elf
37 } // end namespace lld
38
39 #endif // X86_64_RELOCATION_HANDLER_H