From f76d6b3712ffe332dff21c0e17bf8ba6c4222366 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 8 Aug 2013 01:50:52 +0000 Subject: 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 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 7d9382e5233..cf70ad6a2ec 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(); } -- cgit v1.2.3