1//===-- AArch64TargetObjectFile.h - AArch64 Object Info -*- 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#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
10#define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
11
12#include "Utils/AArch64BaseInfo.h"
13#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
14#include "llvm/Target/TargetLoweringObjectFile.h"
15
16namespace llvm {
17
18/// This implementation is used for AArch64 ELF targets (Linux in particular).
19class AArch64_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
20 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
21
22public:
23 const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
24 const MCSymbol *Sym,
25 const MCValue &MV, int64_t Offset,
26 MachineModuleInfo *MMI,
27 MCStreamer &Streamer) const override;
28
29 MCSymbol *getAuthPtrSlotSymbol(const TargetMachine &TM,
30 MachineModuleInfo *MMI, const MCSymbol *RawSym,
31 AArch64PACKey::ID Key,
32 uint16_t Discriminator) const;
33
34 void emitPersonalityValueImpl(MCStreamer &Streamer, const DataLayout &DL,
35 const MCSymbol *Sym,
36 const MachineModuleInfo *MMI) const override;
37
38 MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
39 const TargetMachine &TM) const override;
40
41 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
42 const TargetMachine &TM) const override;
43
44 /// Describe a TLS variable address within debug info.
45 const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
46};
47
48/// AArch64_MachoTargetObjectFile - This TLOF implementation is used for Darwin.
49class AArch64_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
50public:
51 AArch64_MachoTargetObjectFile();
52
53 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
54 unsigned Encoding,
55 const TargetMachine &TM,
56 MachineModuleInfo *MMI,
57 MCStreamer &Streamer) const override;
58
59 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
60 const TargetMachine &TM,
61 MachineModuleInfo *MMI) const override;
62
63 const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
64 const MCSymbol *Sym,
65 const MCValue &MV, int64_t Offset,
66 MachineModuleInfo *MMI,
67 MCStreamer &Streamer) const override;
68
69 void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV,
70 const TargetMachine &TM) const override;
71
72 MCSymbol *getAuthPtrSlotSymbol(const TargetMachine &TM,
73 MachineModuleInfo *MMI, const MCSymbol *RawSym,
74 AArch64PACKey::ID Key,
75 uint16_t Discriminator) const;
76};
77
78/// This implementation is used for AArch64 COFF targets.
79class AArch64_COFFTargetObjectFile : public TargetLoweringObjectFileCOFF {};
80
81} // end namespace llvm
82
83#endif
84