aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-11-09 19:40:22 +0000
committerJim Grosbach <grosbach@apple.com>2010-11-09 19:40:22 +0000
commitc9962aca8f2f2c51794996ac1e2b7731d1d1d497 (patch)
treee9c0ebfd0221a8a6f9013e412a56e3c37e50f66b
parent274191fa705c73ee14b51d3cc5b0cafe3b41c44a (diff)
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
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index 5672bff7e9..30823d7018 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -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);