| ... | ... | @@ -27,8 +27,8 @@ file: fs.File, |
| 27 | 27 | segments: std.ArrayListUnmanaged(macho.segment_command_64) = .{}, |
| 28 | 28 | sections: std.ArrayListUnmanaged(macho.section_64) = .{}, |
| 29 | 29 | |
| 30 | | linkedit_segment_cmd_index: ?u8 = null, |
| 31 | 30 | dwarf_segment_cmd_index: ?u8 = null, |
| 31 | linkedit_segment_cmd_index: ?u8 = null, |
| 32 | 32 | |
| 33 | 33 | debug_info_section_index: ?u8 = null, |
| 34 | 34 | debug_abbrev_section_index: ?u8 = null, |
| ... | ... | @@ -277,7 +277,7 @@ pub fn flushModule(self: *DebugSymbols, allocator: Allocator, options: link.Opti |
| 277 | 277 | const lc_writer = lc_buffer.writer(); |
| 278 | 278 | var ncmds: u32 = 0; |
| 279 | 279 | |
| 280 | | self.updateLinkeditSegment(); |
| 280 | self.finalizeDwarfSegment(); |
| 281 | 281 | try self.writeLinkeditSegmentData(&ncmds, lc_writer); |
| 282 | 282 | |
| 283 | 283 | { |
| ... | ... | @@ -321,9 +321,9 @@ pub fn swapRemoveRelocs(self: *DebugSymbols, target: u32) void { |
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | | fn updateLinkeditSegment(self: *DebugSymbols) void { |
| 324 | fn finalizeDwarfSegment(self: *DebugSymbols) void { |
| 325 | 325 | const base_vmaddr = blk: { |
| 326 | | const last_seg = self.base.segments.items[self.base.segments.items.len - 1]; |
| 326 | const last_seg = self.base.getLinkeditSegmentPtr(); |
| 327 | 327 | break :blk last_seg.vmaddr + last_seg.vmsize; |
| 328 | 328 | }; |
| 329 | 329 | const dwarf_segment = &self.segments.items[self.dwarf_segment_cmd_index.?]; |