Honor explicit section information on Darwin.

llvm-svn: 46267
This commit is contained in:
Dale Johannesen 2008-01-23 00:58:14 +00:00
parent 7fe0bb2b43
commit 7f1ff5fedd
3 changed files with 13 additions and 3 deletions

View File

@ -908,6 +908,10 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
std::string SectionName = ".section " + I->getSection();
SectionName += ",\"aw\",%progbits";
SwitchToDataSection(SectionName.c_str());
} else if (I->hasSection() && Subtarget->isTargetDarwin()) {
// Honor all section names on Darwin; ObjC uses this
std::string SectionName = ".section " + I->getSection();
SwitchToDataSection(SectionName.c_str());
} else {
if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSBSSSection() :

View File

@ -958,8 +958,11 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
break;
}
}
if (!I->isConstant())
if (I->hasSection()) {
// Honor all section names on Darwin; ObjC uses this
std::string SectionName = ".section " + I->getSection();
SwitchToDataSection(SectionName.c_str());
} else if (!I->isConstant())
SwitchToDataSection(TAI->getDataSection(), I);
else {
// Read-only data.

View File

@ -275,7 +275,10 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
assert(!Subtarget->isTargetDarwin());
SectionName += ",\"aw\",@progbits";
}
SwitchToDataSection(SectionName.c_str());
} else if (I->hasSection() && Subtarget->isTargetDarwin()) {
// Honor all section names on Darwin; ObjC uses this
std::string SectionName = ".section " + I->getSection();
SwitchToDataSection(SectionName.c_str());
} else {
if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())