Distinguish .const and .const_data on Darwin, when needed. This is somehow crazy :)

llvm-svn: 53350
This commit is contained in:
Anton Korobeynikov 2008-07-09 20:01:42 +00:00
parent d0a33a9270
commit 5c0d2bd46e
1 changed files with 3 additions and 1 deletions

View File

@ -245,6 +245,7 @@ const Section*
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 @@ X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
else
return (isWeak ? DataCoalSection : getDataSection_());
case SectionKind::ROData:
return (isWeak ? ConstDataCoalSection : getReadOnlySection_());
return (isWeak ? ConstDataCoalSection :
(isNonStatic ? ConstDataSection : getReadOnlySection_()));
case SectionKind::RODataMergeStr:
return (isWeak ?
ConstDataCoalSection :