From 60b131654b2f407a937c5ed505ea1c8fd6a33512 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 15 Jul 2010 21:22:00 +0000 Subject: 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 llvm-svn: 108461 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index a80cfc4b256..3b25714c04b 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/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()); -- cgit v1.2.3