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

llvm-svn: 112472
This commit is contained in:
Benjamin Kramer 2010-08-30 11:59:29 +00:00
parent 6ebea89316
commit f791b9fc56
1 changed files with 1 additions and 1 deletions

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