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() :
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.
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())