OSDN Git Service

fix PR4650: we only track sizes for certain objects, so only put something
authorChris Lattner <sabre@nondot.org>
Fri, 31 Jul 2009 16:17:13 +0000 (16:17 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 31 Jul 2009 16:17:13 +0000 (16:17 +0000)
into the mergable section if it is one of our special cases.  This could
obviously be improved, but this is the minimal fix and restores us to the
previous behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77679 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetLoweringObjectFile.cpp
test/CodeGen/X86/global-sections.ll

index 166f120..a42911d 100644 (file)
@@ -340,7 +340,10 @@ getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str) const {
     Str.push_back('x');
   if (Kind.isWriteable())
     Str.push_back('w');
-  if (Kind.isMergeableConst() || Kind.isMergeableCString())
+  if (Kind.isMergeableCString() ||
+      Kind.isMergeableConst4() ||
+      Kind.isMergeableConst8() ||
+      Kind.isMergeableConst16())
     Str.push_back('M');
   if (Kind.isMergeableCString())
     Str.push_back('S');
index 18a585a..a674a3e 100644 (file)
 ; DARWIN: .globl       "_foo bar"
 ; DARWIN:      .weak_definition "_foo bar"
 ; DARWIN: "_foo bar":
+
+; PR4650
+@G6 = weak_odr constant [1 x i8] c"\01"
+
+; LINUX:   .type       G6,@object
+; LINUX:   .section    .gnu.linkonce.r.G6,"a",@progbits
+; LINUX:   .weak       G6
+; LINUX: G6:                           # G6
+; LINUX:   .size       G6, 1
+; LINUX:   .ascii      "\001"
+
+; DARWIN:  .section __TEXT,__const_coal,coalesced
+; DARWIN:  .globl _G6
+; DARWIN:  .weak_definition _G6
+; DARWIN:_G6:
+; DARWIN:  .ascii "\001"
+