Unresolved weak symbols have value equal zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113358 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Roman Divacky 2010-09-08 14:29:45 +00:00
parent 0b4ab0cfe0
commit 563b38a89a

View File

@ -364,7 +364,7 @@ void ELFObjectWriterImpl::WriteSymbol(MCDataFragment *F, ELFSymbolData &MSD,
if (Data.isCommon() && Data.isExternal())
Value = Data.getCommonAlignment();
if (!Data.isCommon())
if (!Data.isCommon() && !(Data.getFlags() & ELF_STB_Weak))
if (MCFragment *FF = Data.getFragment())
Value = Layout.getSymbolAddress(&Data) -
Layout.getSectionAddress(FF->getParent());