aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MC/MCExpr.cpp')
-rw-r--r--lib/MC/MCExpr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index a9256b6..1d6a316 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -268,8 +268,8 @@ bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
Layout->getAssembler().getSymbolData(Res.getSymA()->getSymbol());
MCSymbolData &B =
Layout->getAssembler().getSymbolData(Res.getSymB()->getSymbol());
- Res = MCValue::get(+ A.getFragment()->getAddress() + A.getOffset()
- - B.getFragment()->getAddress() - B.getOffset()
+ Res = MCValue::get(+ Layout->getSymbolAddress(&A) + A.getOffset()
+ - Layout->getSymbolAddress(&B) - B.getOffset()
+ Res.getConstant());
}