| ... | ... | @@ -1335,17 +1335,20 @@ fn markRelocsDirtyByAddress(self: *MachO, addr: u64) void { |
| 1335 | 1335 | for (self.relocs.values()) |*relocs| { |
| 1336 | 1336 | for (relocs.items) |*reloc| { |
| 1337 | 1337 | const target_addr = reloc.getTargetBaseAddress(self) orelse continue; |
| 1338 | | if (target_addr == 0) continue; |
| 1339 | 1338 | if (target_addr < addr) continue; |
| 1340 | 1339 | reloc.dirty = true; |
| 1341 | 1340 | } |
| 1342 | 1341 | } |
| 1343 | 1342 | |
| 1344 | | // Dirty synthetic table sections if necessary |
| 1345 | | { |
| 1346 | | const target_addr = self.getSegment(self.got_section_index.?).vmaddr; |
| 1347 | | if (target_addr >= addr) self.got_table_contents_dirty = true; |
| 1343 | // TODO: dirty only really affected GOT cells |
| 1344 | for (self.got_table.entries.items) |entry| { |
| 1345 | const target_addr = self.getSymbol(entry).n_value; |
| 1346 | if (target_addr >= addr) { |
| 1347 | self.got_table_contents_dirty = true; |
| 1348 | break; |
| 1349 | } |
| 1348 | 1350 | } |
| 1351 | |
| 1349 | 1352 | { |
| 1350 | 1353 | const stubs_addr = self.getSegment(self.stubs_section_index.?).vmaddr; |
| 1351 | 1354 | const stub_helper_addr = self.getSegment(self.stub_helper_section_index.?).vmaddr; |