| ... | @@ -1542,6 +1542,9 @@ fn scanRelocs(self: *MachO) !void { | ... | @@ -1542,6 +1542,9 @@ fn scanRelocs(self: *MachO) !void { |
| 1542 | for (self.objects.items) |index| { | 1542 | for (self.objects.items) |index| { |
| 1543 | try self.getFile(index).?.createSymbolIndirection(self); | 1543 | try self.getFile(index).?.createSymbolIndirection(self); |
| 1544 | } | 1544 | } |
| | 1545 | for (self.dylibs.items) |index| { |
| | 1546 | try self.getFile(index).?.createSymbolIndirection(self); |
| | 1547 | } |
| 1545 | if (self.getInternalObject()) |obj| { | 1548 | if (self.getInternalObject()) |obj| { |
| 1546 | try obj.asFile().createSymbolIndirection(self); | 1549 | try obj.asFile().createSymbolIndirection(self); |
| 1547 | } | 1550 | } |
| ... | @@ -2358,9 +2361,9 @@ fn allocateLinkeditSegment(self: *MachO) !void { | ... | @@ -2358,9 +2361,9 @@ fn allocateLinkeditSegment(self: *MachO) !void { |
| 2358 | | 2361 | |
| 2359 | fn resizeSections(self: *MachO) !void { | 2362 | fn resizeSections(self: *MachO) !void { |
| 2360 | const slice = self.sections.slice(); | 2363 | const slice = self.sections.slice(); |
| 2361 | for (slice.items(.header), slice.items(.atoms), slice.items(.out)) |header, atoms, *out| { | 2364 | for (slice.items(.header), slice.items(.out), 0..) |header, *out, n_sect| { |
| 2362 | if (atoms.items.len == 0) continue; | | |
| 2363 | if (header.isZerofill()) continue; | 2365 | if (header.isZerofill()) continue; |
| | 2366 | if (self.isZigSection(@intCast(n_sect))) continue; // TODO this is horrible |
| 2364 | const cpu_arch = self.getTarget().cpu.arch; | 2367 | const cpu_arch = self.getTarget().cpu.arch; |
| 2365 | try out.resize(self.base.comp.gpa, header.size); | 2368 | try out.resize(self.base.comp.gpa, header.size); |
| 2366 | const padding_byte: u8 = if (header.isCode() and cpu_arch == .x86_64) 0xcc else 0; | 2369 | const padding_byte: u8 = if (header.isCode() and cpu_arch == .x86_64) 0xcc else 0; |