[ELF] --build-id=fast: switch to xxh3_64bits
authorFangrui Song <i@maskray.me>
Wed, 19 Jul 2023 18:37:42 +0000 (11:37 -0700)
committerFangrui Song <i@maskray.me>
Wed, 19 Jul 2023 18:37:42 +0000 (11:37 -0700)
lld/ELF/Writer.cpp
lld/test/ELF/build-id.s

index ac4d6b7..368c9aa 100644 (file)
@@ -2993,7 +2993,7 @@ template <class ELFT> void Writer<ELFT>::writeBuildId() {
   switch (config->buildId) {
   case BuildIdKind::Fast:
     computeHash(output, input, [](uint8_t *dest, ArrayRef<uint8_t> arr) {
-      write64le(dest, xxHash64(arr));
+      write64le(dest, xxh3_64bits(arr));
     });
     break;
   case BuildIdKind::Md5:
index 05a5e8d..8448809 100644 (file)
@@ -65,7 +65,7 @@ _start:
 # DEFAULT:      Contents of section .note.test:
 # DEFAULT:      Contents of section .note.gnu.build-id:
 # DEFAULT-NEXT: 04000000 08000000 03000000 474e5500  ............GNU.
-# DEFAULT-NEXT: 7e8ddeff 3ed41fa3
+# DEFAULT-NEXT: 630bc2f5 a2584763
 
 # MD5:      Contents of section .note.gnu.build-id:
 # MD5-NEXT: 04000000 10000000 03000000 474e5500  ............GNU.