summaryrefslogtreecommitdiff
path: root/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
commit9706d43b56e16eb3029314e02c499305284e99f1 (patch)
tree92d5d58141ec3f56227bcbc089c3a86df6d749b2 /lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parenta1eacd020f3f7fe7f959ad44f206f71055454c45 (diff)
downloadllvm-9706d43b56e16eb3029314e02c499305284e99f1.tar.gz
llvm-9706d43b56e16eb3029314e02c499305284e99f1.tar.bz2
llvm-9706d43b56e16eb3029314e02c499305284e99f1.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 7d9382e523..cf70ad6a2e 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/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();
}