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