Handle ARM constant pool values that need an explicit reference to the '.'

pseudo-label. (TLS stuff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118609 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2010-11-09 19:40:22 +00:00
parent 274191fa70
commit c9962aca8f

View File

@ -666,7 +666,7 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
Twine Text(DataDirective, OS.str());
OutStreamer.EmitRawText(Text);
} else {
assert(!ACPV->hasModifier() && !ACPV->mustAddCurrentAddress() &&
assert(!ACPV->hasModifier() &&
"ARM binary streamer of non-trivial constant pool value!");
if (ACPV->getPCAdjustment()) {
MCSymbol *PCLabel = getPICLabel(MAI->getPrivateGlobalPrefix(),
@ -679,6 +679,14 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
MCConstantExpr::Create(ACPV->getPCAdjustment(),
OutContext),
OutContext);
if (ACPV->mustAddCurrentAddress()) {
// We want "(<expr> - .)", but MC doesn't have a concept of the '.'
// label, so just emit a local label end reference that instead.
MCSymbol *DotSym = OutContext.CreateTempSymbol();
OutStreamer.EmitLabel(DotSym);
const MCExpr *DotExpr = MCSymbolRefExpr::Create(DotSym, OutContext);
Expr = MCBinaryExpr::CreateSub(Expr, DotExpr, OutContext);
}
Expr = MCBinaryExpr::CreateSub(Expr, PCRelExpr, OutContext);
}
OutStreamer.EmitValue(Expr, Size);