Reland r338088, "ELF: Make --print-icf-sections output deterministic."
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 27 Jul 2018 19:10:44 +0000 (19:10 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 27 Jul 2018 19:10:44 +0000 (19:10 +0000)
commite6c78eafdedfa419d72bc978d124d14bef56ff8e
treeda3d47efc76dd049e55a5d9e1d960937701a4d0f
parentf611ce82c07ee5b8d4e31da7688360b104f2f2b4
Reland r338088, "ELF: Make --print-icf-sections output deterministic."

The xxHash64 function has been made unsigned-char-independent, so
we can reland this change now.

Original commit message:
> The icf-safe.s test currently fails on 32-bit platforms because it uses
> the --print-icf-sections flag and depends on the output appearing in
> a specific order. However, this flag causes the output to depend on
> the order of the sections in the Sections array, which depends on the
> hash values returned from hash_combine, which happen to be different
> for that test between 32-bit and 64-bit platforms.
>
> This change makes the output deterministic by using xxHash64 instead of
> hash_combine.

Differential Revision: https://reviews.llvm.org/D49877

llvm-svn: 338153
lld/ELF/ICF.cpp
lld/test/ELF/icf-safe.s