aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-10-08 21:49:47 +0000
committerDale Johannesen <dalej@apple.com>2008-10-08 21:49:47 +0000
commit585457e37effc1f065281d0dad7858305b304fcb (patch)
tree4ea4d2f4f617cb498ffe1723bf0cb30be1dfd246
parent7a85a62f502cf9d4149f6a26fba0c9973c4d21d0 (diff)
(re)Put const weak strings in appropriate section on Darwin.
g++dg/abi/key2.C git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57309 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Target/DarwinTargetAsmInfo.h1
-rw-r--r--lib/Target/DarwinTargetAsmInfo.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Target/DarwinTargetAsmInfo.h b/include/llvm/Target/DarwinTargetAsmInfo.h
index dab591aa03..a99e16df2c 100644
--- a/include/llvm/Target/DarwinTargetAsmInfo.h
+++ b/include/llvm/Target/DarwinTargetAsmInfo.h
@@ -26,6 +26,7 @@ namespace llvm {
struct DarwinTargetAsmInfo: public TargetAsmInfo {
const Section* TextCoalSection;
+ const Section* ConstTextCoalSection;
const Section* ConstDataCoalSection;
const Section* ConstDataSection;
const Section* DataCoalSection;
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 0e4b09adfe..20866d7617 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -43,6 +43,8 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) {
TextCoalSection =
getNamedSection("\t__TEXT,__textcoal_nt,coalesced,pure_instructions",
SectionFlags::Code);
+ ConstTextCoalSection = getNamedSection("\t__TEXT,__const_coal,coalesced",
+ SectionFlags::None);
ConstDataCoalSection = getNamedSection("\t__DATA,__const_coal,coalesced",
SectionFlags::None);
ConstDataSection = getUnnamedSection(".const_data", SectionFlags::None);
@@ -95,7 +97,7 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
(isNonStatic ? ConstDataSection : getReadOnlySection()));
case SectionKind::RODataMergeStr:
return (isWeak ?
- ConstDataCoalSection :
+ ConstTextCoalSection :
MergeableStringSection(cast<GlobalVariable>(GV)));
case SectionKind::RODataMergeConst:
return (isWeak ?