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

Nick Lewycky nicholas at mxc.ca
Fri Oct 7 13:58:24 PDT 2011


Author: nicholas
Date: Fri Oct  7 15:58:24 2011
New Revision: 141413

URL: http://llvm.org/viewvc/llvm-project?rev=141413&view=rev
Log:
Don't emit a shstrtabindex in the reserved range. Spotted by inspection and
patch by Cary Coutant!

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=141413&r1=141412&r2=141413&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Fri Oct  7 15:58:24 2011
@@ -130,7 +130,7 @@
     Write16(NumberOfSections);
 
   // e_shstrndx  = Section # of '.shstrtab'
-  if (NumberOfSections >= ELF::SHN_LORESERVE)
+  if (ShstrtabIndex >= ELF::SHN_LORESERVE)
     Write16(ELF::SHN_XINDEX);
   else
     Write16(ShstrtabIndex);





More information about the llvm-commits mailing list