File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ void macho::foldIdenticalSections(bool onlyCfStrings) {
457
457
assert (isec->icfEqClass [0 ] == 0 ); // don't overwrite a unique ID!
458
458
// Turn-on the top bit to guarantee that valid hashes have no collisions
459
459
// with the small-integer unique IDs for ICF-ineligible sections
460
- isec->icfEqClass [0 ] = xxHash64 (isec->data ) | (1ull << 31 );
460
+ isec->icfEqClass [0 ] = xxh3_64bits (isec->data ) | (1ull << 31 );
461
461
});
462
462
// Now that every input section is either hashed or marked as unique, run the
463
463
// segregation algorithm to detect foldable subsections.
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ void CStringInputSection::splitIntoPieces() {
246
246
size_t end = s.find (0 );
247
247
if (end == StringRef::npos)
248
248
fatal (getLocation (off) + " : string is not null terminated" );
249
- uint32_t hash = deduplicateLiterals ? xxHash64 (s.take_front (end)) : 0 ;
249
+ uint32_t hash = deduplicateLiterals ? xxh3_64bits (s.take_front (end)) : 0 ;
250
250
pieces.emplace_back (off, hash);
251
251
size_t size = end + 1 ; // include null terminator
252
252
s = s.substr (size);
Original file line number Diff line number Diff line change @@ -1677,7 +1677,7 @@ void DeduplicatedCStringSection::writeTo(uint8_t *buf) const {
1677
1677
DeduplicatedCStringSection::StringOffset
1678
1678
DeduplicatedCStringSection::getStringOffset (StringRef str) const {
1679
1679
// StringPiece uses 31 bits to store the hashes, so we replicate that
1680
- uint32_t hash = xxHash64 (str) & 0x7fffffff ;
1680
+ uint32_t hash = xxh3_64bits (str) & 0x7fffffff ;
1681
1681
auto offset = stringOffsetMap.find (CachedHashStringRef (str, hash));
1682
1682
assert (offset != stringOffsetMap.end () &&
1683
1683
" Looked-up strings should always exist in section" );
Original file line number Diff line number Diff line change @@ -1190,14 +1190,14 @@ void Writer::writeUuid() {
1190
1190
threadFutures.reserve (chunks.size ());
1191
1191
for (size_t i = 0 ; i < chunks.size (); ++i)
1192
1192
threadFutures.emplace_back (threadPool.async (
1193
- [&](size_t j) { hashes[j] = xxHash64 (chunks[j]); }, i));
1193
+ [&](size_t j) { hashes[j] = xxh3_64bits (chunks[j]); }, i));
1194
1194
for (std::shared_future<void > &future : threadFutures)
1195
1195
future.wait ();
1196
1196
// Append the output filename so that identical binaries with different names
1197
1197
// don't get the same UUID.
1198
- hashes[chunks.size ()] = xxHash64 (sys::path::filename (config->finalOutput ));
1199
- uint64_t digest = xxHash64 ({reinterpret_cast <uint8_t *>(hashes.data ()),
1200
- hashes.size () * sizeof (uint64_t )});
1198
+ hashes[chunks.size ()] = xxh3_64bits (sys::path::filename (config->finalOutput ));
1199
+ uint64_t digest = xxh3_64bits ({reinterpret_cast <uint8_t *>(hashes.data ()),
1200
+ hashes.size () * sizeof (uint64_t )});
1201
1201
uuidCommand->writeUuid (digest);
1202
1202
}
1203
1203
You can’t perform that action at this time.
0 commit comments