Change ConstantArray to 2.5 API.
[oota-llvm.git] / lib / Target / XCore / XCoreTargetObjectFile.cpp
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 using namespace llvm;
12
13
14 XCoreTargetObjectFile::XCoreTargetObjectFile(bool isXS1A) {
15   TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
16   DataSection = getOrCreateSection("\t.dp.data", false, SectionKind::DataRel);
17   BSSSection_ = getOrCreateSection("\t.dp.bss", false, SectionKind::BSS);
18   
19   // TLS globals are lowered in the backend to arrays indexed by the current
20   // thread id. After lowering they require no special handling by the linker
21   // and can be placed in the standard data / bss sections.
22   TLSDataSection = DataSection;
23   TLSBSSSection = BSSSection_;
24   
25   if (isXS1A)
26     // FIXME: Why is this writable ("datarel")???
27     ReadOnlySection = getOrCreateSection("\t.dp.rodata", false,
28                                          SectionKind::DataRel);
29   else
30     ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
31                                          SectionKind::ReadOnly);
32 }