OSDN Git Service

tidy up
authorChris Lattner <sabre@nondot.org>
Sun, 7 Mar 2010 04:28:09 +0000 (04:28 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 7 Mar 2010 04:28:09 +0000 (04:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97895 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetLoweringObjectFileImpl.cpp

index 3b3be5d..d127f53 100644 (file)
@@ -651,16 +651,16 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
   }
 
   // FIXME: Alignment check should be handled by section classifier.
-  if (Kind.isMergeable1ByteCString() ||
-      (Kind.isMergeable2ByteCString() && !GV->hasExternalLinkage())) {
-    if (TM.getTargetData()->getPreferredAlignment(
-                                              cast<GlobalVariable>(GV)) < 32) {
-      if (Kind.isMergeable1ByteCString())
-        return CStringSection;
-      assert(Kind.isMergeable2ByteCString());
-      return UStringSection;
-    }
-  }
+  if (Kind.isMergeable1ByteCString() &&
+      TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV)) < 32)
+    return CStringSection;
+      
+  // Do not put 16-bit arrays in the UString section if they have an
+  // externally visible label, this runs into issues with certain linker
+  // versions.
+  if (Kind.isMergeable2ByteCString() && !GV->hasExternalLinkage() &&
+      TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV)) < 32)
+    return UStringSection;
 
   if (Kind.isMergeableConst()) {
     if (Kind.isMergeableConst4())