diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-10-13 03:30:21 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-10-13 03:30:21 +0000 |
commit | d3043965b9ebaecc4dd60c5dbd1049982adc2520 (patch) | |
tree | de1df90b6890cc4ac5b0861730869ca9404d8a15 /llvm/lib/Object/ELFObjectFile.cpp | |
parent | 594a54582119b51f1b2764b58f381ed0068068f6 (diff) | |
download | bcm5719-llvm-d3043965b9ebaecc4dd60c5dbd1049982adc2520.tar.gz bcm5719-llvm-d3043965b9ebaecc4dd60c5dbd1049982adc2520.zip |
Elf_Word is not POD! Stop using it in a DenseMap.
llvm-svn: 141851
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/ELFObjectFile.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 7add2d8a52e..f30d6a03699 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -296,7 +296,7 @@ class ELFObjectFile : public ObjectFile { 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 @@ public: 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 @@ error_code ELFObjectFile<target_endianness, is64Bits> } 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 @@ template<support::endianness target_endianness, bool is64Bits> 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); |