blob: 13d7b4ad70d64baf408637a9d892db1f75ac3207 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- X86TargetObjectFile.h - X86 Object Info -----------------*- C++ -*-===//
Chris Lattnerb8666022009-09-16 01:46:41 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Chris Lattnerb8666022009-09-16 01:46:41 +00006//
7//===----------------------------------------------------------------------===//
8
Benjamin Kramera7c40ef2014-08-13 16:26:38 +00009#ifndef LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H
10#define LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H
Chris Lattnerb8666022009-09-16 01:46:41 +000011
Anton Korobeynikovab663a02010-02-15 22:37:53 +000012#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
David Blaikie6054e652018-03-23 23:58:19 +000013#include "llvm/Target/TargetLoweringObjectFile.h"
Chris Lattnerb8666022009-09-16 01:46:41 +000014
15namespace llvm {
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000016
Bill Wendling8ed44462012-06-26 10:05:06 +000017 /// X86_64MachoTargetObjectFile - This TLOF implementation is used for Darwin
Bill Wendling03448742010-03-15 19:04:37 +000018 /// x86-64.
Bill Wendling8ed44462012-06-26 10:05:06 +000019 class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
Bill Wendling03448742010-03-15 19:04:37 +000020 public:
Eric Christopher4367c7f2016-09-16 07:33:15 +000021 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
22 unsigned Encoding,
23 const TargetMachine &TM,
24 MachineModuleInfo *MMI,
25 MCStreamer &Streamer) const override;
Rafael Espindola08704342011-04-27 23:08:15 +000026
27 // getCFIPersonalitySymbol - The symbol that gets passed to
28 // .cfi_personality.
Eric Christopher4367c7f2016-09-16 07:33:15 +000029 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
Rafael Espindoladaeafb42014-02-19 17:23:20 +000030 const TargetMachine &TM,
Craig Topper73156022014-03-02 09:09:27 +000031 MachineModuleInfo *MMI) const override;
Bruno Cardoso Lopes24492b02015-02-23 21:26:18 +000032
Bruno Cardoso Lopes618c67a2015-03-06 13:49:05 +000033 const MCExpr *getIndirectSymViaGOTPCRel(const MCSymbol *Sym,
34 const MCValue &MV, int64_t Offset,
35 MachineModuleInfo *MMI,
36 MCStreamer &Streamer) const override;
Chris Lattnerb8666022009-09-16 01:46:41 +000037 };
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000038
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000039 /// This implemenatation is used for X86 ELF targets that don't
Paul Robinson06a8eb82015-03-03 21:01:27 +000040 /// have a further specialization.
41 class X86ELFTargetObjectFile : public TargetLoweringObjectFileELF {
Peter Collingbourne265ebd72016-04-22 20:40:10 +000042 public:
43 X86ELFTargetObjectFile() {
44 PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
45 }
46
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000047 /// Describe a TLS variable address within debug info.
Craig Topper73156022014-03-02 09:09:27 +000048 const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
Rafael Espindolaca3e0ee2012-06-19 00:48:28 +000049 };
50
Davide Italianoa9f85d62016-09-26 22:53:15 +000051 /// X86FreeBSDTargetObjectFile - This implementation is used for FreeBSD
52 /// on x86 and x86-64.
53 class X86FreeBSDTargetObjectFile : public X86ELFTargetObjectFile {
54 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
55 };
56
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000057 /// This implementation is used for Fuchsia on x86-64.
Petr Hoseke023d622016-10-06 05:17:26 +000058 class X86FuchsiaTargetObjectFile : public X86ELFTargetObjectFile {
59 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
60 };
61
Derek Schuff072f93f2015-03-11 16:16:09 +000062 /// X86LinuxNaClTargetObjectFile - This implementation is used for linux and
63 /// Native Client on x86 and x86-64.
64 class X86LinuxNaClTargetObjectFile : public X86ELFTargetObjectFile {
Paul Robinson06a8eb82015-03-03 21:01:27 +000065 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
66 };
67
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000068 /// This implementation is used for Solaris on x86/x86-64.
Davide Italiano9b8e3d32017-06-21 20:36:32 +000069 class X86SolarisTargetObjectFile : public X86ELFTargetObjectFile {
70 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
71 };
72
Chris Lattnerb8666022009-09-16 01:46:41 +000073} // end namespace llvm
74
75#endif