ARM TLS: implement "general dynamic", "initial exec" and "local exec" models.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lauro Ramos Venancio
2007-04-27 13:54:47 +00:00
parent b1df8f2750
commit 64f4fa5e0e
8 changed files with 157 additions and 13 deletions

View File

@@ -134,10 +134,14 @@ namespace {
} else
O << Name;
if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")";
if (ACPV->getPCAdjustment() != 0)
if (ACPV->getPCAdjustment() != 0) {
O << "-(" << TAI->getPrivateGlobalPrefix() << "PC"
<< utostr(ACPV->getLabelId())
<< "+" << (unsigned)ACPV->getPCAdjustment() << ")";
<< "+" << (unsigned)ACPV->getPCAdjustment();
if (ACPV->mustAddCurrentAddress())
O << "-.";
O << ")";
}
O << "\n";
// If the constant pool value is a extern weak symbol, remember to emit
@@ -869,9 +873,13 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
SwitchToDataSection(SectionName.c_str());
} else {
if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
SwitchToDataSection(TAI->getBSSSection(), I);
SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSBSSSection() :
TAI->getBSSSection(), I);
else if (!I->isConstant())
SwitchToDataSection(TAI->getDataSection(), I);
SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSDataSection() :
TAI->getDataSection(), I);
else if (I->isThreadLocal())
SwitchToDataSection(TAI->getTLSDataSection());
else {
// Read-only data.
bool HasReloc = C->ContainsRelocations();