| ... | @@ -6441,6 +6441,21 @@ fn snapshotState(self: *MachO) !void { | ... | @@ -6441,6 +6441,21 @@ fn snapshotState(self: *MachO) !void { |
| 6441 | | 6441 | |
| 6442 | while (true) { | 6442 | while (true) { |
| 6443 | const atom_sym = self.locals.items[atom.local_sym_index]; | 6443 | const atom_sym = self.locals.items[atom.local_sym_index]; |
| | 6444 | const should_skip_atom: bool = blk: { |
| | 6445 | if (self.mh_execute_header_index) |index| { |
| | 6446 | if (index == atom.local_sym_index) break :blk true; |
| | 6447 | } |
| | 6448 | if (mem.eql(u8, self.getString(atom_sym.n_strx), "___dso_handle")) break :blk true; |
| | 6449 | break :blk false; |
| | 6450 | }; |
| | 6451 | |
| | 6452 | if (should_skip_atom) { |
| | 6453 | if (atom.next) |next| { |
| | 6454 | atom = next; |
| | 6455 | } else break; |
| | 6456 | continue; |
| | 6457 | } |
| | 6458 | |
| 6444 | var node = Snapshot.Node{ | 6459 | var node = Snapshot.Node{ |
| 6445 | .address = atom_sym.n_value, | 6460 | .address = atom_sym.n_value, |
| 6446 | .tag = .atom_start, | 6461 | .tag = .atom_start, |
| ... | @@ -6480,7 +6495,8 @@ fn snapshotState(self: *MachO) !void { | ... | @@ -6480,7 +6495,8 @@ fn snapshotState(self: *MachO) !void { |
| 6480 | }; | 6495 | }; |
| 6481 | | 6496 | |
| 6482 | if (is_via_got) { | 6497 | if (is_via_got) { |
| 6483 | const got_atom = self.got_entries_table.get(rel.target) orelse break :blk 0; | 6498 | const got_index = self.got_entries_table.get(rel.target) orelse break :blk 0; |
| | 6499 | const got_atom = self.got_entries.items[got_index].atom; |
| 6484 | break :blk self.locals.items[got_atom.local_sym_index].n_value; | 6500 | break :blk self.locals.items[got_atom.local_sym_index].n_value; |
| 6485 | } | 6501 | } |
| 6486 | | 6502 | |