(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
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 0e4b09a..20866d7 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -43,6 +43,8 @@
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 @@
(isNonStatic ? ConstDataSection : getReadOnlySection()));
case SectionKind::RODataMergeStr:
return (isWeak ?
- ConstDataCoalSection :
+ ConstTextCoalSection :
MergeableStringSection(cast<GlobalVariable>(GV)));
case SectionKind::RODataMergeConst:
return (isWeak ?