[lld] r287730 - Revert r287727: Use SHA1::hash and MD5::hash functions.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 17:19:14 PST 2016


Author: ruiu
Date: Tue Nov 22 19:19:13 2016
New Revision: 287730

URL: http://llvm.org/viewvc/llvm-project?rev=287730&view=rev
Log:
Revert r287727: Use SHA1::hash and MD5::hash functions.

It broke buildbots.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=287730&r1=287729&r2=287730&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Nov 22 19:19:13 2016
@@ -359,12 +359,18 @@ void BuildIdSection<ELFT>::writeBuildId(
     break;
   case BuildIdKind::Md5:
     computeHash(Buf, [](uint8_t *Dest, ArrayRef<uint8_t> Arr) {
-      memcpy(Dest, MD5::hash(Arr).data(), 16);
+      MD5 Hash;
+      Hash.update(Arr);
+      MD5::MD5Result Res;
+      Hash.final(Res);
+      memcpy(Dest, Res, 16);
     });
     break;
   case BuildIdKind::Sha1:
     computeHash(Buf, [](uint8_t *Dest, ArrayRef<uint8_t> Arr) {
-      memcpy(Dest, SHA1::hash(Arr).data(), 20);
+      SHA1 Hash;
+      Hash.update(Arr);
+      memcpy(Dest, Hash.final().data(), 20);
     });
     break;
   case BuildIdKind::Uuid:




More information about the llvm-commits mailing list