summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-15 21:22:00 +0000
committerChris Lattner <sabre@nondot.org>2010-07-15 21:22:00 +0000
commit6a624a65f47c850bbcbfc7eff4fd057be824027c (patch)
tree0dbffe8ceb8129a64a6e2e258b8487d4ec3a8cd4 /lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parenta955853961da51330995b48329e61131235b166c (diff)
downloadllvm-6a624a65f47c850bbcbfc7eff4fd057be824027c.tar.gz
llvm-6a624a65f47c850bbcbfc7eff4fd057be824027c.tar.bz2
llvm-6a624a65f47c850bbcbfc7eff4fd057be824027c.tar.xz
fix the definitions of ConstTextCoalSection/ConstDataCoalSection
to keep "Text" in sync with the "pure instructions" section attribute. Lack of this attribute was preventing the assembler from emitting multibyte noops instructions for templates (and inlines, and other coalesced stuff) and was causing the assembler to mismatch .o files. This fixes rdar://8018335 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index a80cfc4b25..3b25714c04 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -518,12 +518,13 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
SectionKind::getText());
ConstTextCoalSection
= getContext().getMachOSection("__TEXT", "__const_coal",
- MCSectionMachO::S_COALESCED,
+ MCSectionMachO::S_COALESCED |
+ MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
SectionKind::getText());
ConstDataCoalSection
= getContext().getMachOSection("__DATA","__const_coal",
MCSectionMachO::S_COALESCED,
- SectionKind::getText());
+ SectionKind::getReadOnly());
ConstDataSection // .const_data
= getContext().getMachOSection("__DATA", "__const", 0,
SectionKind::getReadOnlyWithRel());