Index external symbols by symbol table instead of parent section, by Roman Divacky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112472 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-08-30 11:59:29 +00:00
parent 82a3171b72
commit 679d236117

View File

@ -470,7 +470,7 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
MCFragment *F = SD.getFragment();
if (Base) {
if (F && (!Symbol->isInSection() || SD.isCommon())) {
if (F && (!Symbol->isInSection() || SD.isCommon()) && !SD.isExternal()) {
Index = F->getParent()->getOrdinal() + LocalSymbolData.size() + 1;
Value += Layout.getSymbolAddress(&SD);
} else