aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-27 17:39:40 +0000
committerChris Lattner <sabre@nondot.org>2009-07-27 17:39:40 +0000
commit4dfeb8f4bb3d7d741f2212a9fe582c864cbc1724 (patch)
tree161dfe2fe27ae39cefc7b330a2b2c91b614d52cb
parent20e367ad452422d330b0206ce44f0715cfb60274 (diff)
downloadexternal_llvm-4dfeb8f4bb3d7d741f2212a9fe582c864cbc1724.zip
external_llvm-4dfeb8f4bb3d7d741f2212a9fe582c864cbc1724.tar.gz
external_llvm-4dfeb8f4bb3d7d741f2212a9fe582c864cbc1724.tar.bz2
add an explanatory comment about why we drop these in readonly and
not in mergable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77210 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/TargetAsmInfo.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index ce905ef..f5c1458 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -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;