1 //===-- AArch64TargetObjectFile.h - AArch64 Object Info -*- C++ ---------*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
12 #include "Utils/AArch64BaseInfo.h"
13 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
14 #include "llvm/Target/TargetLoweringObjectFile.h"
18 /// This implementation is used for AArch64 ELF targets (Linux in particular).
19 class AArch64_ELFTargetObjectFile
: public TargetLoweringObjectFileELF
{
20 void Initialize(MCContext
&Ctx
, const TargetMachine
&TM
) override
;
23 AArch64_ELFTargetObjectFile() {
24 PLTRelativeVariantKind
= MCSymbolRefExpr::VK_PLT
;
25 SupportIndirectSymViaGOTPCRel
= true;
28 const MCExpr
*getIndirectSymViaGOTPCRel(const GlobalValue
*GV
,
30 const MCValue
&MV
, int64_t Offset
,
31 MachineModuleInfo
*MMI
,
32 MCStreamer
&Streamer
) const override
;
34 MCSymbol
*getAuthPtrSlotSymbol(const TargetMachine
&TM
,
35 MachineModuleInfo
*MMI
, const MCSymbol
*RawSym
,
36 AArch64PACKey::ID Key
,
37 uint16_t Discriminator
) const;
40 /// AArch64_MachoTargetObjectFile - This TLOF implementation is used for Darwin.
41 class AArch64_MachoTargetObjectFile
: public TargetLoweringObjectFileMachO
{
43 AArch64_MachoTargetObjectFile();
45 const MCExpr
*getTTypeGlobalReference(const GlobalValue
*GV
,
47 const TargetMachine
&TM
,
48 MachineModuleInfo
*MMI
,
49 MCStreamer
&Streamer
) const override
;
51 MCSymbol
*getCFIPersonalitySymbol(const GlobalValue
*GV
,
52 const TargetMachine
&TM
,
53 MachineModuleInfo
*MMI
) const override
;
55 const MCExpr
*getIndirectSymViaGOTPCRel(const GlobalValue
*GV
,
57 const MCValue
&MV
, int64_t Offset
,
58 MachineModuleInfo
*MMI
,
59 MCStreamer
&Streamer
) const override
;
61 void getNameWithPrefix(SmallVectorImpl
<char> &OutName
, const GlobalValue
*GV
,
62 const TargetMachine
&TM
) const override
;
64 MCSymbol
*getAuthPtrSlotSymbol(const TargetMachine
&TM
,
65 MachineModuleInfo
*MMI
, const MCSymbol
*RawSym
,
66 AArch64PACKey::ID Key
,
67 uint16_t Discriminator
) const;
70 /// This implementation is used for AArch64 COFF targets.
71 class AArch64_COFFTargetObjectFile
: public TargetLoweringObjectFileCOFF
{};
73 } // end namespace llvm