diff options
author | Reid Kleckner <rnk@google.com> | 2016-10-20 00:13:34 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-10-20 00:13:34 +0000 |
commit | 2918d0b4b25d71d8d4b4cae9ce3721f1d147f43f (patch) | |
tree | 0e4252671cbf1ffc0511a274d322f521f4b336e8 | |
parent | a7ece03b322c5cef25b90c82e51e8860d8be2a2f (diff) | |
download | bcm5719-llvm-2918d0b4b25d71d8d4b4cae9ce3721f1d147f43f.tar.gz bcm5719-llvm-2918d0b4b25d71d8d4b4cae9ce3721f1d147f43f.zip |
Fix narrowing conversion error in 32-bit MSVC builds
Use size_t instead of ELFT::uint for the string table offset. If the
linker is built 32-bit, it can't write an output file larger than 2GB.
Other code in this area uses size_t as well.
llvm-svn: 284680
-rw-r--r-- | lld/ELF/OutputSections.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/OutputSections.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 06c9de86427..90561bc5b04 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -633,7 +633,7 @@ void GnuHashTableSection<ELFT>::addSymbols(std::vector<SymbolTableEntry> &V) { return; for (auto I = Mid, E = V.end(); I != E; ++I) { SymbolBody *B = I->Symbol; - typename ELFT::uint StrOff = I->StrTabOffset; + size_t StrOff = I->StrTabOffset; Symbols.push_back({B, StrOff, hashGnu(B->getName())}); } diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index f73c41856c2..f5a527094a8 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -266,7 +266,7 @@ private: struct SymbolTableEntry { SymbolBody *Symbol; - std::size_t StrTabOffset; + size_t StrTabOffset; }; template <class ELFT> |