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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 12:02:36 PDT 2015


Thank you for finding this out. Fixed in r248526.

On Tue, Sep 22, 2015 at 12:50 AM, Denis Protivensky via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> 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
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150924/5c237ce5/attachment.html>


More information about the llvm-commits mailing list