mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-17 03:07:06 +00:00
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:
parent
274191fa70
commit
c9962aca8f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user