add an explanatory comment about why we drop these in readonly and
authorChris Lattner <sabre@nondot.org>
Mon, 27 Jul 2009 17:39:40 +0000 (17:39 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 27 Jul 2009 17:39:40 +0000 (17:39 +0000)
not in mergable

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

lib/Target/TargetAsmInfo.cpp

index ce905effa79726b442599438aec1c79cdddcc10d..f5c1458e3d831736cddda61c8a86c648a06f65fe 100644 (file)
@@ -247,7 +247,9 @@ static SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV,
     case Constant::LocalRelocation:
       // In static relocation model, the linker will resolve all addresses, so
       // the relocation entries will actually be constants by the time the app
-      // starts up.
+      // starts up.  However, we can't put this into a mergable section, because
+      // the linker doesn't take relocations into consideration when it tries to
+      // merge entries in the section.
       if (ReloModel == Reloc::Static)
         return SectionKind::ReadOnly;
               
@@ -258,7 +260,9 @@ static SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV,
     case Constant::GlobalRelocations:
       // In static relocation model, the linker will resolve all addresses, so
       // the relocation entries will actually be constants by the time the app
-      // starts up.
+      // starts up.  However, we can't put this into a mergable section, because
+      // the linker doesn't take relocations into consideration when it tries to
+      // merge entries in the section.
       if (ReloModel == Reloc::Static)
         return SectionKind::ReadOnly;