1 //===-- XCoreTargetObjectFile.cpp - XCore object files --------------------===//
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 #include "XCoreTargetObjectFile.h"
11 #include "XCoreSubtarget.h"
12 #include "llvm/Target/TargetMachine.h"
16 void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
17 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
19 TextSection = getELFSection("\t.text", true, SectionKind::getText());
20 DataSection = getELFSection("\t.dp.data", false, SectionKind::getDataRel());
21 BSSSection = getELFSection("\t.dp.bss", false, SectionKind::getBSS());
23 // TLS globals are lowered in the backend to arrays indexed by the current
24 // thread id. After lowering they require no special handling by the linker
25 // and can be placed in the standard data / bss sections.
26 TLSDataSection = DataSection;
27 TLSBSSSection = BSSSection;
29 if (TM.getSubtarget<XCoreSubtarget>().isXS1A())
30 // FIXME: Why is this writable ("datarel")???
31 ReadOnlySection = getELFSection("\t.dp.rodata", false,
32 SectionKind::getDataRel());
34 ReadOnlySection = getELFSection("\t.cp.rodata", false,
35 SectionKind::getReadOnly());