[llvm-commits] [llvm] r53350 - /llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Wed Jul 9 13:01:43 PDT 2008
Author: asl
Date: Wed Jul 9 15:01:42 2008
New Revision: 53350
URL: http://llvm.org/viewvc/llvm-project?rev=53350&view=rev
Log:
Distinguish .const and .const_data on Darwin, when needed. This is somehow crazy :)
Modified:
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=53350&r1=53349&r2=53350&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Wed Jul 9 15:01:42 2008
@@ -245,6 +245,7 @@
X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
SectionKind::Kind Kind = SectionKindForGlobal(GV);
bool isWeak = GV->isWeakForLinker();
+ bool isNonStatic = (X86TM->getRelocationModel() != Reloc::Static);
switch (Kind) {
case SectionKind::Text:
@@ -261,7 +262,8 @@
else
return (isWeak ? DataCoalSection : getDataSection_());
case SectionKind::ROData:
- return (isWeak ? ConstDataCoalSection : getReadOnlySection_());
+ return (isWeak ? ConstDataCoalSection :
+ (isNonStatic ? ConstDataSection : getReadOnlySection_()));
case SectionKind::RODataMergeStr:
return (isWeak ?
ConstDataCoalSection :
More information about the llvm-commits
mailing list