File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,13 @@ struct BPOrdererMachO : lld::BPOrderer<BPOrdererMachO> {
6161
6262 // Calculate relocation hashes
6363 for (const auto &r : sec.relocs ) {
64- if (r.length == 0 || r.referent .isNull () || r.offset >= data.size ())
64+ uint32_t relocLength = 1 << r.length ;
65+ if (r.referent .isNull () || r.offset + relocLength > data.size ())
6566 continue ;
6667
6768 uint64_t relocHash = getRelocHash (r, sectionToIdx);
6869 uint32_t start = (r.offset < windowSize) ? 0 : r.offset - windowSize + 1 ;
69- for (uint32_t i = start; i < r.offset + r. length ; i++) {
70+ for (uint32_t i = start; i < r.offset + relocLength ; i++) {
7071 auto window = data.drop_front (i).take_front (windowSize);
7172 hashes.push_back (xxh3_64bits (window) ^ relocHash);
7273 }
You can’t perform that action at this time.
0 commit comments