summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2009-08-18 21:14:31 +0000
committerRichard Osborne <richard@xmos.com>2009-08-18 21:14:31 +0000
commit1123135dbfa776bbe4c2120a16098d81e0850a76 (patch)
treedd62ebff8682c94a35a553a091f474f27af27973 /lib
parent3731604f1f73cb29a9554660b27aecba1c5c032b (diff)
downloadllvm-1123135dbfa776bbe4c2120a16098d81e0850a76.tar.gz
llvm-1123135dbfa776bbe4c2120a16098d81e0850a76.tar.bz2
llvm-1123135dbfa776bbe4c2120a16098d81e0850a76.tar.xz
Add support for mergeable sections back into the XCore backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/XCore/XCoreTargetObjectFile.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/Target/XCore/XCoreTargetObjectFile.cpp b/lib/Target/XCore/XCoreTargetObjectFile.cpp
index 91cb11533d..c1990d6d0f 100644
--- a/lib/Target/XCore/XCoreTargetObjectFile.cpp
+++ b/lib/Target/XCore/XCoreTargetObjectFile.cpp
@@ -28,11 +28,24 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
MCSectionXCore::SHF_DP_SECTION,
SectionKind::getBSS(), false, getContext());
- // For now, disable lowering of mergable sections, just drop everything into
- // ReadOnly.
- MergeableConst4Section = 0;
- MergeableConst8Section = 0;
- MergeableConst16Section = 0;
+ MergeableConst4Section =
+ MCSectionXCore::Create(".cp.rodata.cst4", MCSectionELF::SHT_PROGBITS,
+ MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
+ MCSectionXCore::SHF_CP_SECTION,
+ SectionKind::getMergeableConst4(), false,
+ getContext());
+ MergeableConst8Section =
+ MCSectionXCore::Create(".cp.rodata.cst8", MCSectionELF::SHT_PROGBITS,
+ MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
+ MCSectionXCore::SHF_CP_SECTION,
+ SectionKind::getMergeableConst8(), false,
+ getContext());
+ MergeableConst16Section =
+ MCSectionXCore::Create(".cp.rodata.cst16", MCSectionELF::SHT_PROGBITS,
+ MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE |
+ MCSectionXCore::SHF_CP_SECTION,
+ SectionKind::getMergeableConst16(), false,
+ getContext());
// TLS globals are lowered in the backend to arrays indexed by the current
// thread id. After lowering they require no special handling by the linker