Revert 114678 and 114667 to see if
http://google1.osuosl.org:8011/builders/llvm-gcc-i386-linux-selfhost
gets happy.
llvm-svn: 114742
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 9eb9bca..1189b73 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -515,12 +515,9 @@
}
if (Base) {
- if (F && !SD.isExternal()) {
+ if (F && (!Symbol->isInSection() || SD.isCommon()) && !SD.isExternal()) {
Index = F->getParent()->getOrdinal() + LocalSymbolData.size() + 1;
-
- MCSectionData *FSD = F->getParent();
- // Offset of the symbol in the section
- Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
+ Value += Layout.getSymbolAddress(&SD);
} else
Index = getSymbolIndexInSymbolTable(Asm, Symbol);
if (Base != &SD)