| ... | ... | @@ -2223,6 +2223,7 @@ fn createLazyPointerAtom(self: *MachO, stub_sym_index: u32) !*TextBlock { |
| 2223 | 2223 | }, |
| 2224 | 2224 | }, |
| 2225 | 2225 | }); |
| 2226 | try atom.rebases.append(self.base.allocator, 0); |
| 2226 | 2227 | self.lazy_binding_info_dirty = true; |
| 2227 | 2228 | return atom; |
| 2228 | 2229 | } |
| ... | ... | @@ -3002,21 +3003,6 @@ fn writeRebaseInfoTableZld(self: *MachO) !void { |
| 3002 | 3003 | } |
| 3003 | 3004 | } |
| 3004 | 3005 | |
| 3005 | | if (self.la_symbol_ptr_section_index) |idx| { |
| 3006 | | const seg = self.load_commands.items[self.data_segment_cmd_index.?].Segment; |
| 3007 | | const sect = seg.sections.items[idx]; |
| 3008 | | const base_offset = sect.addr - seg.inner.vmaddr; |
| 3009 | | const segment_id = @intCast(u16, self.data_segment_cmd_index.?); |
| 3010 | | |
| 3011 | | try pointers.ensureUnusedCapacity(self.stubs.items.len); |
| 3012 | | for (self.stubs.items) |_, i| { |
| 3013 | | pointers.appendAssumeCapacity(.{ |
| 3014 | | .offset = base_offset + i * @sizeOf(u64), |
| 3015 | | .segment_id = segment_id, |
| 3016 | | }); |
| 3017 | | } |
| 3018 | | } |
| 3019 | | |
| 3020 | 3006 | std.sort.sort(bind.Pointer, pointers.items, {}, bind.pointerCmp); |
| 3021 | 3007 | |
| 3022 | 3008 | const size = try bind.rebaseInfoSize(pointers.items); |
| ... | ... | @@ -5104,21 +5090,6 @@ fn writeRebaseInfoTable(self: *MachO) !void { |
| 5104 | 5090 | } |
| 5105 | 5091 | } |
| 5106 | 5092 | |
| 5107 | | if (self.la_symbol_ptr_section_index) |idx| { |
| 5108 | | const seg = self.load_commands.items[self.data_segment_cmd_index.?].Segment; |
| 5109 | | const sect = seg.sections.items[idx]; |
| 5110 | | const base_offset = sect.addr - seg.inner.vmaddr; |
| 5111 | | const segment_id = @intCast(u16, self.data_segment_cmd_index.?); |
| 5112 | | |
| 5113 | | try pointers.ensureUnusedCapacity(self.stubs.items.len); |
| 5114 | | for (self.stubs.items) |_, i| { |
| 5115 | | pointers.appendAssumeCapacity(.{ |
| 5116 | | .offset = base_offset + i * @sizeOf(u64), |
| 5117 | | .segment_id = segment_id, |
| 5118 | | }); |
| 5119 | | } |
| 5120 | | } |
| 5121 | | |
| 5122 | 5093 | std.sort.sort(bind.Pointer, pointers.items, {}, bind.pointerCmp); |
| 5123 | 5094 | |
| 5124 | 5095 | const size = try bind.rebaseInfoSize(pointers.items); |