[llvm-commits] [llvm] r141851 - /llvm/trunk/lib/Object/ELFObjectFile.cpp

Nick Lewycky nicholas at mxc.ca
Wed Oct 12 20:30:21 PDT 2011


Author: nicholas
Date: Wed Oct 12 22:30:21 2011
New Revision: 141851

URL: http://llvm.org/viewvc/llvm-project?rev=141851&view=rev
Log:
Elf_Word is not POD! Stop using it in a DenseMap.

Modified:
    llvm/trunk/lib/Object/ELFObjectFile.cpp

Modified: llvm/trunk/lib/Object/ELFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFObjectFile.cpp?rev=141851&r1=141850&r2=141851&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/ELFObjectFile.cpp Wed Oct 12 22:30:21 2011
@@ -296,7 +296,7 @@
   const Elf_Shdr *dot_strtab_sec;   // Symbol header string table.
   Sections_t SymbolTableSections;
   IndexMap_t SymbolTableSectionsIndexMap;
-  DenseMap<const Elf_Sym*, Elf_Word> ExtendedSymbolTable;
+  DenseMap<const Elf_Sym*, ELF::Elf64_Word> ExtendedSymbolTable;
 
   /// @brief Map sections to an array of relocation sections that reference
   ///        them sorted by section index.
@@ -375,7 +375,7 @@
 
   uint64_t getNumSections() const;
   uint64_t getStringTableIndex() const;
-  uint64_t getSymbolTableIndex(const Elf_Sym *symb) const;
+  ELF::Elf64_Word getSymbolTableIndex(const Elf_Sym *symb) const;
   const Elf_Shdr *getSection(const Elf_Sym *symb) const;
 };
 } // end namespace
@@ -433,7 +433,7 @@
 }
 
 template<support::endianness target_endianness, bool is64Bits>
-uint64_t ELFObjectFile<target_endianness, is64Bits>
+ELF::Elf64_Word ELFObjectFile<target_endianness, is64Bits>
                       ::getSymbolTableIndex(const Elf_Sym *symb) const {
   if (symb->st_shndx == ELF::SHN_XINDEX)
     return ExtendedSymbolTable.lookup(symb);
@@ -444,11 +444,8 @@
 const typename ELFObjectFile<target_endianness, is64Bits>::Elf_Shdr *
 ELFObjectFile<target_endianness, is64Bits>
                              ::getSection(const Elf_Sym *symb) const {
-  if (symb->st_shndx == ELF::SHN_XINDEX) {
-    if (!ExtendedSymbolTable.count(symb))
-      return 0;
+  if (symb->st_shndx == ELF::SHN_XINDEX)
     return getSection(ExtendedSymbolTable.lookup(symb));
-  }
   if (symb->st_shndx >= ELF::SHN_LORESERVE)
     return 0;
   return getSection(symb->st_shndx);





More information about the llvm-commits mailing list