[llvm-commits] [llvm] r113375 - in /llvm/trunk/lib/MC: ELFObjectWriter.cpp MCELFStreamer.cpp

Roman Divacky rdivacky at freebsd.org
Wed Sep 8 11:08:40 PDT 2010


Author: rdivacky
Date: Wed Sep  8 13:08:40 2010
New Revision: 113375

URL: http://llvm.org/viewvc/llvm-project?rev=113375&view=rev
Log:
ELF_STB_Local is 0 so setting and checking it must be done specially


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

Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=113375&r1=113374&r2=113375&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Wed Sep  8 13:08:40 2010
@@ -439,7 +439,7 @@
     assert((Data.getFlags() & ELF_STB_Global) &&
            "External symbol requires STB_GLOBAL flag");
     WriteSymbol(F, MSD, Layout);
-    if (Data.getFlags() & ELF_STB_Local)
+    if ((Data.getFlags() & (0xf << ELF_STB_Shift)) == ELF_STB_Local)
       LastLocalSymbolIndex++;
   }
 
@@ -448,7 +448,7 @@
     MCSymbolData &Data = *MSD.SymbolData;
     Data.setFlags(Data.getFlags() | ELF_STB_Global);
     WriteSymbol(F, MSD, Layout);
-    if (Data.getFlags() & ELF_STB_Local)
+    if ((Data.getFlags() & (0xf << ELF_STB_Shift)) == ELF_STB_Local)
       LastLocalSymbolIndex++;
   }
 }

Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=113375&r1=113374&r2=113375&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Wed Sep  8 13:08:40 2010
@@ -196,7 +196,9 @@
     break;
 
   case MCSA_Local:
-    SD.setFlags(SD.getFlags() | ELF_STB_Local);
+    // ELF_STB_Local is 0, so zero the ELF_STB area
+    // SD.getFlags() | ELF_STB_Local is a NOP
+    SD.setFlags(SD.getFlags() & ~(0xf << ELF_STB_Shift));
     break;
 
   case MCSA_ELF_TypeFunction:





More information about the llvm-commits mailing list