[lld] r248202 - COFF: Improve section hash value.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 12:41:38 PDT 2015


Author: ruiu
Date: Mon Sep 21 14:41:38 2015
New Revision: 248202

URL: http://llvm.org/viewvc/llvm-project?rev=248202&view=rev
Log:
COFF: Improve section hash value.

std::distance(C->Relocs.end(), C->Relocs.begin()) is the same as NumRelocs
which is already added to the hash value. What we are missing here is the
section size.

Modified:
    lld/trunk/COFF/ICF.cpp

Modified: lld/trunk/COFF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/ICF.cpp?rev=248202&r1=248201&r2=248202&view=diff
==============================================================================
--- lld/trunk/COFF/ICF.cpp (original)
+++ lld/trunk/COFF/ICF.cpp Mon Sep 21 14:41:38 2015
@@ -86,7 +86,7 @@ uint64_t ICF::getHash(SectionChunk *C) {
                       hash_value(C->SectionName),
                       C->NumRelocs,
                       uint32_t(C->Header->SizeOfRawData),
-                      std::distance(C->Relocs.end(), C->Relocs.begin()),
+                      uint32_t(C->Header->SizeOfRawData),
                       C->Checksum);
 }
 




More information about the llvm-commits mailing list