Weak stuff always goes to coalesced sections on Darwin
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 9 Jul 2008 19:06:02 +0000 (19:06 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 9 Jul 2008 19:06:02 +0000 (19:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53340 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetAsmInfo.cpp

index ec9864074f821624a9db66858c7eb04c8a6456fb..965e8d6b77a9e2d63a9fd014af83c9b626a765a6 100644 (file)
@@ -263,9 +263,13 @@ X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
    case SectionKind::ROData:
     return (isWeak ? ConstDataCoalSection : getReadOnlySection_());
    case SectionKind::RODataMergeStr:
-    return MergeableStringSection(cast<GlobalVariable>(GV));
+    return (isWeak ?
+            ConstDataCoalSection :
+            MergeableStringSection(cast<GlobalVariable>(GV)));
    case SectionKind::RODataMergeConst:
-    return MergeableConstSection(cast<GlobalVariable>(GV));
+    return (isWeak ?
+            ConstDataCoalSection:
+            MergeableConstSection(cast<GlobalVariable>(GV)));
    default:
     assert(0 && "Unsuported section kind for global");
   }