From 679d236117f9d04c304b39c1076259295cf7eb5e Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 30 Aug 2010 11:59:29 +0000 Subject: [PATCH] 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 --- lib/MC/ELFObjectWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 1704fb023d4..97604176b22 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -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