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 = getOrCreateSection("\t.text", true,
20 SectionKind::get(SectionKind::Text));
21 DataSection = getOrCreateSection("\t.dp.data", false,
22 SectionKind::get(SectionKind::DataRel));
23 BSSSection = getOrCreateSection("\t.dp.bss", false,
24 SectionKind::get(SectionKind::BSS));
26 // TLS globals are lowered in the backend to arrays indexed by the current
27 // thread id. After lowering they require no special handling by the linker
28 // and can be placed in the standard data / bss sections.
29 TLSDataSection = DataSection;
30 TLSBSSSection = BSSSection;
32 if (TM.getSubtarget<XCoreSubtarget>().isXS1A())
33 // FIXME: Why is this writable ("datarel")???
34 ReadOnlySection = getOrCreateSection("\t.dp.rodata", false,
35 SectionKind::get(SectionKind::DataRel));
37 ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
38 SectionKind::get(SectionKind::ReadOnly));