LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XCoreTargetObjectFile.cpp
Go to the documentation of this file.
1 //===-- XCoreTargetObjectFile.cpp - XCore object files --------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "XCoreTargetObjectFile.h"
11 #include "XCoreSubtarget.h"
12 #include "llvm/MC/MCContext.h"
13 #include "llvm/MC/MCSectionELF.h"
14 #include "llvm/Support/ELF.h"
16 using namespace llvm;
17 
18 
21 
22  DataSection =
23  Ctx.getELFSection(".dp.data", ELF::SHT_PROGBITS,
24  ELF::SHF_ALLOC | ELF::SHF_WRITE |
25  ELF::XCORE_SHF_DP_SECTION,
27  BSSSection =
28  Ctx.getELFSection(".dp.bss", ELF::SHT_NOBITS,
29  ELF::SHF_ALLOC | ELF::SHF_WRITE |
30  ELF::XCORE_SHF_DP_SECTION,
32 
34  Ctx.getELFSection(".cp.rodata.cst4", ELF::SHT_PROGBITS,
35  ELF::SHF_ALLOC | ELF::SHF_MERGE |
36  ELF::XCORE_SHF_CP_SECTION,
39  Ctx.getELFSection(".cp.rodata.cst8", ELF::SHT_PROGBITS,
40  ELF::SHF_ALLOC | ELF::SHF_MERGE |
41  ELF::XCORE_SHF_CP_SECTION,
44  Ctx.getELFSection(".cp.rodata.cst16", ELF::SHT_PROGBITS,
45  ELF::SHF_ALLOC | ELF::SHF_MERGE |
46  ELF::XCORE_SHF_CP_SECTION,
48 
49  // TLS globals are lowered in the backend to arrays indexed by the current
50  // thread id. After lowering they require no special handling by the linker
51  // and can be placed in the standard data / bss sections.
54 
56  Ctx.getELFSection(".cp.rodata", ELF::SHT_PROGBITS,
57  ELF::SHF_ALLOC |
58  ELF::XCORE_SHF_CP_SECTION,
60 }
const MCSectionELF * getELFSection(StringRef Section, unsigned Type, unsigned Flags, SectionKind Kind)
Definition: MCContext.cpp:244
static SectionKind getDataRel()
Definition: SectionKind.h:229
static SectionKind getMergeableConst8()
Definition: SectionKind.h:221
static SectionKind getMergeableConst16()
Definition: SectionKind.h:222
static SectionKind getMergeableConst4()
Definition: SectionKind.h:220
static SectionKind getBSS()
Definition: SectionKind.h:225
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
void Initialize(MCContext &Ctx, const TargetMachine &TM)
const MCSection * MergeableConst8Section
const MCSection * BSSSection
BSSSection - Section that is default initialized to zero.
static SectionKind getReadOnlyWithRel()
Definition: SectionKind.h:232
const MCSection * ReadOnlySection
const MCSection * TLSBSSSection
const MCSection * MergeableConst16Section
const MCSection * TLSDataSection
const MCSection * DataSection
const MCSection * MergeableConst4Section