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

Denis Protivensky via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 00:50:20 PDT 2015


On 09/21/2015 10:41 PM, Rui Ueyama via llvm-commits wrote:
> 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),
Is that correct that you now use the same value twice (the first is 
above the deleted line)?
>                         C->Checksum);
>   }
>   
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list