aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-04-28 20:53:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-04-28 20:53:11 +0000
commitbc91d7e25af11f74eb0da4aea179d496cbe40dc7 (patch)
treefb550c57227740b6032401fa65c47f40e15b6882 /llvm/lib/MC/ELFObjectWriter.cpp
parent793c7479b5a8e00ecb8d6c9e11ea0a34b032e28b (diff)
downloadllvm-bc91d7e25af11f74eb0da4aea179d496cbe40dc7.zip
llvm-bc91d7e25af11f74eb0da4aea179d496cbe40dc7.tar.gz
llvm-bc91d7e25af11f74eb0da4aea179d496cbe40dc7.tar.bz2
Add an option for evaluating past symbols.
When evaluating an assembly expression for a relocation, we want to stop at MCSymbols that are in the symbol table, even if they are variables. This is needed since the semantics may require that the relocation use them. That is not the case when computing the value of a symbol in the symbol table. There are no relocations in this case and we have to keep going until we hit a section or find out that the expression doesn't have an assembly time value. llvm-svn: 207445
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 68e28cf..1b7ac64 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -496,7 +496,7 @@ uint64_t ELFObjectWriter::SymbolValue(MCSymbolData &OrigData,
if (Symbol->isVariable()) {
const MCExpr *Expr = Symbol->getVariableValue();
MCValue Value;
- if (!Expr->EvaluateAsRelocatable(Value, &Layout))
+ if (!Expr->EvaluateAsValue(Value, &Layout))
llvm_unreachable("Invalid expression");
assert(!Value.getSymB());
@@ -606,7 +606,7 @@ static const MCSymbol *getBaseSymbol(const MCAsmLayout &Layout,
const MCExpr *Expr = Symbol.getVariableValue();
MCValue Value;
- if (!Expr->EvaluateAsRelocatable(Value, &Layout))
+ if (!Expr->EvaluateAsValue(Value, &Layout))
llvm_unreachable("Invalid Expression");
const MCSymbolRefExpr *RefB = Value.getSymB();
if (RefB) {