diff options
author | Roman Divacky <rdivacky@freebsd.org> | 2010-12-20 21:14:39 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@freebsd.org> | 2010-12-20 21:14:39 +0000 |
commit | d149186e156fdd44e3cca988949cf3e5e6940863 (patch) | |
tree | 74efac118ca0a68c975251d77915be76c8ec7fbe /lib/MC/ELFObjectWriter.cpp | |
parent | d7a0852464ab05327e949fc232138a2b85e4c177 (diff) | |
download | external_llvm-d149186e156fdd44e3cca988949cf3e5e6940863.zip external_llvm-d149186e156fdd44e3cca988949cf3e5e6940863.tar.gz external_llvm-d149186e156fdd44e3cca988949cf3e5e6940863.tar.bz2 |
Set the value of absolute symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | lib/MC/ELFObjectWriter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 1bb4775..bb523ce 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -518,6 +518,15 @@ static uint64_t SymbolValue(MCSymbolData &Data, const MCAsmLayout &Layout) { return Data.getCommonAlignment(); const MCSymbol &Symbol = Data.getSymbol(); + + if (Symbol.isAbsolute() && Symbol.isVariable()) { + if (const MCExpr *Value = Symbol.getVariableValue()) { + int64_t IntValue; + if (Value->EvaluateAsAbsolute(IntValue, Layout)) + return (uint64_t)IntValue; + } + } + if (!Symbol.isInSection()) return 0; |