aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCAsmStreamer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 43ce04f..41f8833 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -136,11 +136,18 @@ void MCAsmStreamer::EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
if (MakeAbsolute) {
OS << ".set " << Symbol << ", " << Value << '\n';
+
+ // HACK: If the value isn't already absolute, set the symbol value to
+ // itself, we want to use the .set absolute value, not the actual
+ // expression.
+ if (!Value.isAbsolute())
+ getContext().SetSymbolValue(Symbol, MCValue::get(Symbol));
+ else
+ getContext().SetSymbolValue(Symbol, Value);
} else {
OS << Symbol << " = " << Value << '\n';
+ getContext().SetSymbolValue(Symbol, Value);
}
-
- getContext().SetSymbolValue(Symbol, Value);
}
void MCAsmStreamer::EmitSymbolAttribute(MCSymbol *Symbol,