1 //===-- NVPTXTargetObjectFile.h - NVPTX Object Info -------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
11 #define LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
13 #include "NVPTXSection.h"
14 #include "llvm/Target/TargetLoweringObjectFile.h"
21 class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
24 NVPTXTargetObjectFile() {}
25 ~NVPTXTargetObjectFile() {
29 delete ReadOnlySection;
31 delete StaticCtorSection;
32 delete StaticDtorSection;
34 delete EHFrameSection;
35 delete DwarfAbbrevSection;
36 delete DwarfInfoSection;
37 delete DwarfLineSection;
38 delete DwarfFrameSection;
39 delete DwarfPubTypesSection;
40 delete DwarfDebugInlineSection;
41 delete DwarfStrSection;
42 delete DwarfLocSection;
43 delete DwarfARangesSection;
44 delete DwarfRangesSection;
45 delete DwarfMacroInfoSection;
48 virtual void Initialize(MCContext &ctx, const TargetMachine &TM) {
49 TextSection = new NVPTXSection(MCSection::SV_ELF,
50 SectionKind::getText());
51 DataSection = new NVPTXSection(MCSection::SV_ELF,
52 SectionKind::getDataRel());
53 BSSSection = new NVPTXSection(MCSection::SV_ELF,
54 SectionKind::getBSS());
55 ReadOnlySection = new NVPTXSection(MCSection::SV_ELF,
56 SectionKind::getReadOnly());
58 StaticCtorSection = new NVPTXSection(MCSection::SV_ELF,
59 SectionKind::getMetadata());
60 StaticDtorSection = new NVPTXSection(MCSection::SV_ELF,
61 SectionKind::getMetadata());
62 LSDASection = new NVPTXSection(MCSection::SV_ELF,
63 SectionKind::getMetadata());
64 EHFrameSection = new NVPTXSection(MCSection::SV_ELF,
65 SectionKind::getMetadata());
66 DwarfAbbrevSection = new NVPTXSection(MCSection::SV_ELF,
67 SectionKind::getMetadata());
68 DwarfInfoSection = new NVPTXSection(MCSection::SV_ELF,
69 SectionKind::getMetadata());
70 DwarfLineSection = new NVPTXSection(MCSection::SV_ELF,
71 SectionKind::getMetadata());
72 DwarfFrameSection = new NVPTXSection(MCSection::SV_ELF,
73 SectionKind::getMetadata());
74 DwarfPubTypesSection = new NVPTXSection(MCSection::SV_ELF,
75 SectionKind::getMetadata());
76 DwarfDebugInlineSection = new NVPTXSection(MCSection::SV_ELF,
77 SectionKind::getMetadata());
78 DwarfStrSection = new NVPTXSection(MCSection::SV_ELF,
79 SectionKind::getMetadata());
80 DwarfLocSection = new NVPTXSection(MCSection::SV_ELF,
81 SectionKind::getMetadata());
82 DwarfARangesSection = new NVPTXSection(MCSection::SV_ELF,
83 SectionKind::getMetadata());
84 DwarfRangesSection = new NVPTXSection(MCSection::SV_ELF,
85 SectionKind::getMetadata());
86 DwarfMacroInfoSection = new NVPTXSection(MCSection::SV_ELF,
87 SectionKind::getMetadata());
90 virtual const MCSection *getSectionForConstant(SectionKind Kind) const {
91 return ReadOnlySection;
94 virtual const MCSection *
95 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
97 const TargetMachine &TM) const {
103 } // end namespace llvm