Skip to content

Commit 970c199

Browse files
fix: gnu hash bloom filter stride on 64-bit arm
1 parent 8f33893 commit 970c199

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/core/bindings/native_process.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,12 @@ NativeProcess::enumerateExports(const std::string &moduleName) {
631631
auto gh = reinterpret_cast<const uint32_t *>(d->d_un.d_ptr);
632632
gnuNbuckets = gh[0];
633633
gnuSymndx = gh[1];
634-
// bloom filter: gh[2] words starting at gh[4]
635-
// buckets follow bloom
634+
// bloom filter: gh[2] bloom-word count; each bloom word is
635+
// ElfW(Addr)-sized (8 bytes on 64-bit = 2 × uint32_t).
636+
// Buckets immediately follow the bloom filter.
636637
uint32_t bloomWords = gh[2];
637-
gnuBuckets = gh + 4 + bloomWords;
638+
uint32_t bloomU32s = bloomWords * (sizeof(ElfW(Addr)) / sizeof(uint32_t));
639+
gnuBuckets = gh + 4 + bloomU32s;
638640
break;
639641
}
640642
}

0 commit comments

Comments
 (0)