[llvm-commits] [llvm] r114678 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp

Rafael Espindola rafael.espindola at gmail.com
Thu Sep 23 11:01:31 PDT 2010


Author: rafael
Date: Thu Sep 23 13:01:31 2010
New Revision: 114678

URL: http://llvm.org/viewvc/llvm-project?rev=114678&view=rev
Log:
Correctly compute the offset of the symbol. Forgot these bits from the
last commit.

Modified:
    llvm/trunk/lib/MC/ELFObjectWriter.cpp

Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=114678&r1=114677&r2=114678&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu Sep 23 13:01:31 2010
@@ -504,7 +504,10 @@
     if (Base) {
       if (F && !SD.isExternal()) {
         Index = F->getParent()->getOrdinal() + LocalSymbolData.size() + 1;
-        Value += Layout.getSymbolAddress(&SD);
+
+        MCSectionData *FSD = F->getParent();
+        // Offset of the symbol in the section
+        Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
       } else
         Index = getSymbolIndexInSymbolTable(Asm, Symbol);
       if (Base != &SD)





More information about the llvm-commits mailing list