| Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- X86TargetObjectFile.h - X86 Object Info -----------------*- C++ -*-===// |
| Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 2 | // |
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
| Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 9 | #ifndef LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H |
| 10 | #define LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H |
| Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 11 | |
| Anton Korobeynikov | ab663a0 | 2010-02-15 22:37:53 +0000 | [diff] [blame] | 12 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
| David Blaikie | 6054e65 | 2018-03-23 23:58:19 +0000 | [diff] [blame] | 13 | #include "llvm/Target/TargetLoweringObjectFile.h" |
| Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 14 | |
| 15 | namespace llvm { |
| Anton Korobeynikov | ae4ccc1 | 2010-02-15 22:35:59 +0000 | [diff] [blame] | 16 | |
| Bill Wendling | 8ed4446 | 2012-06-26 10:05:06 +0000 | [diff] [blame] | 17 | /// X86_64MachoTargetObjectFile - This TLOF implementation is used for Darwin |
| Bill Wendling | 0344874 | 2010-03-15 19:04:37 +0000 | [diff] [blame] | 18 | /// x86-64. |
| Bill Wendling | 8ed4446 | 2012-06-26 10:05:06 +0000 | [diff] [blame] | 19 | class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO { |
| Bill Wendling | 0344874 | 2010-03-15 19:04:37 +0000 | [diff] [blame] | 20 | public: |
| Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 21 | const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, |
| 22 | unsigned Encoding, |
| 23 | const TargetMachine &TM, |
| 24 | MachineModuleInfo *MMI, |
| 25 | MCStreamer &Streamer) const override; |
| Rafael Espindola | 0870434 | 2011-04-27 23:08:15 +0000 | [diff] [blame] | 26 | |
| 27 | // getCFIPersonalitySymbol - The symbol that gets passed to |
| 28 | // .cfi_personality. |
| Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 29 | MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, |
| Rafael Espindola | daeafb4 | 2014-02-19 17:23:20 +0000 | [diff] [blame] | 30 | const TargetMachine &TM, |
| Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 31 | MachineModuleInfo *MMI) const override; |
| Bruno Cardoso Lopes | 24492b0 | 2015-02-23 21:26:18 +0000 | [diff] [blame] | 32 | |
| Bruno Cardoso Lopes | 618c67a | 2015-03-06 13:49:05 +0000 | [diff] [blame] | 33 | const MCExpr *getIndirectSymViaGOTPCRel(const MCSymbol *Sym, |
| 34 | const MCValue &MV, int64_t Offset, |
| 35 | MachineModuleInfo *MMI, |
| 36 | MCStreamer &Streamer) const override; |
| Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 37 | }; |
| Anton Korobeynikov | ae4ccc1 | 2010-02-15 22:35:59 +0000 | [diff] [blame] | 38 | |
| Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 39 | /// This implemenatation is used for X86 ELF targets that don't |
| Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame] | 40 | /// have a further specialization. |
| 41 | class X86ELFTargetObjectFile : public TargetLoweringObjectFileELF { |
| Peter Collingbourne | 265ebd7 | 2016-04-22 20:40:10 +0000 | [diff] [blame] | 42 | public: |
| 43 | X86ELFTargetObjectFile() { |
| 44 | PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT; |
| 45 | } |
| 46 | |
| Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 47 | /// Describe a TLS variable address within debug info. |
| Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 48 | const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override; |
| Rafael Espindola | ca3e0ee | 2012-06-19 00:48:28 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
| Davide Italiano | a9f85d6 | 2016-09-26 22:53:15 +0000 | [diff] [blame] | 51 | /// 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 Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 57 | /// This implementation is used for Fuchsia on x86-64. |
| Petr Hosek | e023d62 | 2016-10-06 05:17:26 +0000 | [diff] [blame] | 58 | class X86FuchsiaTargetObjectFile : public X86ELFTargetObjectFile { |
| 59 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 60 | }; |
| 61 | |
| Derek Schuff | 072f93f | 2015-03-11 16:16:09 +0000 | [diff] [blame] | 62 | /// X86LinuxNaClTargetObjectFile - This implementation is used for linux and |
| 63 | /// Native Client on x86 and x86-64. |
| 64 | class X86LinuxNaClTargetObjectFile : public X86ELFTargetObjectFile { |
| Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame] | 65 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 66 | }; |
| 67 | |
| Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 68 | /// This implementation is used for Solaris on x86/x86-64. |
| Davide Italiano | 9b8e3d3 | 2017-06-21 20:36:32 +0000 | [diff] [blame] | 69 | class X86SolarisTargetObjectFile : public X86ELFTargetObjectFile { |
| 70 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 71 | }; |
| 72 | |
| Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 73 | } // end namespace llvm |
| 74 | |
| 75 | #endif |