xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
10b57cec5SDimitry Andric //===-- AArch64TargetObjectFile.h - AArch64 Object Info -*- C++ ---------*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
110b57cec5SDimitry Andric 
12*0fca6ea1SDimitry Andric #include "Utils/AArch64BaseInfo.h"
130b57cec5SDimitry Andric #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
140b57cec5SDimitry Andric #include "llvm/Target/TargetLoweringObjectFile.h"
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric namespace llvm {
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric /// This implementation is used for AArch64 ELF targets (Linux in particular).
190b57cec5SDimitry Andric class AArch64_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
200b57cec5SDimitry Andric   void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
215ffd83dbSDimitry Andric 
225ffd83dbSDimitry Andric public:
AArch64_ELFTargetObjectFile()235ffd83dbSDimitry Andric   AArch64_ELFTargetObjectFile() {
245ffd83dbSDimitry Andric     PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
257a6dacacSDimitry Andric     SupportIndirectSymViaGOTPCRel = true;
265ffd83dbSDimitry Andric   }
277a6dacacSDimitry Andric 
287a6dacacSDimitry Andric   const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
297a6dacacSDimitry Andric                                           const MCSymbol *Sym,
307a6dacacSDimitry Andric                                           const MCValue &MV, int64_t Offset,
317a6dacacSDimitry Andric                                           MachineModuleInfo *MMI,
327a6dacacSDimitry Andric                                           MCStreamer &Streamer) const override;
33*0fca6ea1SDimitry Andric 
34*0fca6ea1SDimitry Andric   MCSymbol *getAuthPtrSlotSymbol(const TargetMachine &TM,
35*0fca6ea1SDimitry Andric                                  MachineModuleInfo *MMI, const MCSymbol *RawSym,
36*0fca6ea1SDimitry Andric                                  AArch64PACKey::ID Key,
37*0fca6ea1SDimitry Andric                                  uint16_t Discriminator) const;
380b57cec5SDimitry Andric };
390b57cec5SDimitry Andric 
400b57cec5SDimitry Andric /// AArch64_MachoTargetObjectFile - This TLOF implementation is used for Darwin.
410b57cec5SDimitry Andric class AArch64_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
420b57cec5SDimitry Andric public:
430b57cec5SDimitry Andric   AArch64_MachoTargetObjectFile();
440b57cec5SDimitry Andric 
450b57cec5SDimitry Andric   const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
460b57cec5SDimitry Andric                                         unsigned Encoding,
470b57cec5SDimitry Andric                                         const TargetMachine &TM,
480b57cec5SDimitry Andric                                         MachineModuleInfo *MMI,
490b57cec5SDimitry Andric                                         MCStreamer &Streamer) const override;
500b57cec5SDimitry Andric 
510b57cec5SDimitry Andric   MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
520b57cec5SDimitry Andric                                     const TargetMachine &TM,
530b57cec5SDimitry Andric                                     MachineModuleInfo *MMI) const override;
540b57cec5SDimitry Andric 
558bcb0991SDimitry Andric   const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
568bcb0991SDimitry Andric                                           const MCSymbol *Sym,
570b57cec5SDimitry Andric                                           const MCValue &MV, int64_t Offset,
580b57cec5SDimitry Andric                                           MachineModuleInfo *MMI,
590b57cec5SDimitry Andric                                           MCStreamer &Streamer) const override;
600b57cec5SDimitry Andric 
610b57cec5SDimitry Andric   void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV,
620b57cec5SDimitry Andric                          const TargetMachine &TM) const override;
63*0fca6ea1SDimitry Andric 
64*0fca6ea1SDimitry Andric   MCSymbol *getAuthPtrSlotSymbol(const TargetMachine &TM,
65*0fca6ea1SDimitry Andric                                  MachineModuleInfo *MMI, const MCSymbol *RawSym,
66*0fca6ea1SDimitry Andric                                  AArch64PACKey::ID Key,
67*0fca6ea1SDimitry Andric                                  uint16_t Discriminator) const;
680b57cec5SDimitry Andric };
690b57cec5SDimitry Andric 
700b57cec5SDimitry Andric /// This implementation is used for AArch64 COFF targets.
710b57cec5SDimitry Andric class AArch64_COFFTargetObjectFile : public TargetLoweringObjectFileCOFF {};
720b57cec5SDimitry Andric 
730b57cec5SDimitry Andric } // end namespace llvm
740b57cec5SDimitry Andric 
750b57cec5SDimitry Andric #endif
76