[lld] r270327 - Use uintX_t instead of unsigned.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat May 21 12:22:46 PDT 2016


Author: ruiu
Date: Sat May 21 14:22:46 2016
New Revision: 270327

URL: http://llvm.org/viewvc/llvm-project?rev=270327&view=rev
Log:
Use uintX_t instead of unsigned.

This fixes a potential bug when cross linking very large executables
on LLP64 machines such as Windows. On such platform, uintX_t is 64 bits
while unsigned is 32 bits.

Modified:
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=270327&r1=270326&r2=270327&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Sat May 21 14:22:46 2016
@@ -1140,7 +1140,7 @@ void EHOutputSection<ELFT>::addSectionAu
   ArrayRef<uint8_t> D = S->getSectionData();
   uintX_t Offset = 0;
 
-  DenseMap<unsigned, unsigned> OffsetToIndex;
+  DenseMap<uintX_t, uintX_t> OffsetToIndex;
   while (!D.empty()) {
     unsigned Index = S->Offsets.size();
     S->Offsets.push_back(std::make_pair(Offset, -1));

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=270327&r1=270326&r2=270327&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Sat May 21 14:22:46 2016
@@ -364,7 +364,7 @@ private:
   std::vector<Cie<ELFT>> Cies;
 
   // Maps CIE content + personality to a index in Cies.
-  llvm::DenseMap<std::pair<StringRef, SymbolBody *>, unsigned> CieMap;
+  llvm::DenseMap<std::pair<StringRef, SymbolBody *>, uintX_t> CieMap;
   bool Finalized = false;
 };
 




More information about the llvm-commits mailing list