aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-08-08 01:50:52 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-08-08 01:50:52 +0000
commitf76d6b3712ffe332dff21c0e17bf8ba6c4222366 (patch)
tree85de35c2156feccabd34aef63d08e42b1619c0c1 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent493df1a14f5dc5267a029c6ff58018efe0647297 (diff)
downloadllvm-f76d6b3712ffe332dff21c0e17bf8ba6c4222366.zip
llvm-f76d6b3712ffe332dff21c0e17bf8ba6c4222366.tar.gz
llvm-f76d6b3712ffe332dff21c0e17bf8ba6c4222366.tar.bz2
Revert "coff also doesn't have a ReadOnlySection yet, (!)"
This reverts commit r77814. We were sticking global constants in the .data section instead of in the .rdata section when emitting for COFF. This fixes PR16831. llvm-svn: 187956
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 7d9382e..cf70ad6 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -776,6 +776,9 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
if (Kind.isThreadLocal())
return getTLSDataSection();
+ if (Kind.isReadOnly() && ReadOnlySection != 0)
+ return ReadOnlySection;
+
return getDataSection();
}