authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-01-19 14:06:47+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-01-19 14:06:47+01:00
logbcd16b270861e814e59c699837b1e35db84ab091
tree03ee27c1fb64291099773269fef7863aa1cd2f8c
parentb2febd1ce703ec7af8fdf21ec966c0f1b94a98f2

macho: fix ordering issue with lazy bind pointers


1 files changed, 3 insertions(+), 3 deletions(-)

src/link/MachO.zig+3-3
......@@ -3421,11 +3421,11 @@ fn populateLazyBindOffsetsInStubHelper(self: *MachO, lazy_bind: LazyBind) !void
34213421 const header = section.header;
34223422 var atom = section.last_atom.?;
34233423
3424 var index: usize = lazy_bind.offsets.items.len;
3425 while (index > 0) : (index -= 1) {
3424 var index: usize = 0;
3425 while (index < lazy_bind.offsets.items.len) : (index += 1) {
34263426 const sym = atom.getSymbol(self);
34273427 const file_offset = header.offset + sym.n_value - header.addr + stub_offset;
3428 const bind_offset = lazy_bind.offsets.items[index - 1];
3428 const bind_offset = lazy_bind.offsets.items[index];
34293429
34303430 log.debug("writing lazy bind offset 0x{x} in stub helper at 0x{x}", .{ bind_offset, file_offset });
34313431