The value is offset from the start of the section for non-common symbols, submitted by Jordan Gordeev.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-08-30 12:00:16 +00:00
parent 679d236117
commit 51799ddc7c

View File

@ -384,6 +384,8 @@ void ELFObjectWriterImpl::WriteSymbol(MCDataFragment *F, ELFSymbolData &MSD,
}
} else if (ESize->getKind() == MCExpr::Constant) {
Size = static_cast<const MCConstantExpr *>(ESize)->getValue();
MCFragment *F = Data.getFragment();
Value = Layout.getSymbolAddress(&Data) - Layout.getSectionAddress(F->getParent());
} else {
assert(0 && "Unsupported size expression");
}