Remove a FIXME: we really need to use const_data section on darwin for
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 9 Jul 2008 21:54:26 +0000 (21:54 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 9 Jul 2008 21:54:26 +0000 (21:54 +0000)
constant pool, if relocation model is not static. This directly maps to
the way how GCC works.

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

lib/Target/X86/X86TargetAsmInfo.cpp

index 87024a8c171c97cc93807279eb05485cb05e256a..d7438607559d404349247c0e73a96c4793b13bf0 100644 (file)
@@ -139,9 +139,10 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
   PrivateGlobalPrefix = "L";     // Marker for constant pool idxs
   BSSSection = 0;                       // no BSS section.
   ZeroFillDirective = "\t.zerofill\t";  // Uses .zerofill
-  // FIXME: It seems, this should be .const_data if relocation model is not
-  // static.
-  ConstantPoolSection = "\t.const\n";
+  if (X86TM->getRelocationModel() != Reloc::Static)
+    ConstantPoolSection = "\t.const_data";
+  else
+    ConstantPoolSection = "\t.const\n";
   JumpTableDataSection = "\t.const\n";
   CStringSection = "\t.cstring";
   CStringSection_ = getUnnamedSection("\t.cstring",