| ... | ... | @@ -2551,8 +2551,6 @@ fn createDsoHandleAtom(self: *MachO) !void { |
| 2551 | 2551 | const vaddr = try self.allocateAtom(atom, 0, 1, match); |
| 2552 | 2552 | sym.n_value = vaddr; |
| 2553 | 2553 | } else try self.addAtomAndBumpSectionSize(atom, match); |
| 2554 | | |
| 2555 | | atom.dirty = false; // We don't really want to write it to file. |
| 2556 | 2554 | } |
| 2557 | 2555 | } |
| 2558 | 2556 | |
| ... | ... | @@ -2898,7 +2896,6 @@ fn createMhExecuteHeaderAtom(self: *MachO) !void { |
| 2898 | 2896 | sym.n_value = vaddr; |
| 2899 | 2897 | } else try self.addAtomAndBumpSectionSize(atom, match); |
| 2900 | 2898 | |
| 2901 | | atom.dirty = false; |
| 2902 | 2899 | self.mh_execute_header_index = local_sym_index; |
| 2903 | 2900 | } |
| 2904 | 2901 | |
| ... | ... | @@ -2963,6 +2960,8 @@ fn resolveDyldStubBinder(self: *MachO) !void { |
| 2963 | 2960 | } |
| 2964 | 2961 | |
| 2965 | 2962 | fn parseObjectsIntoAtoms(self: *MachO) !void { |
| 2963 | // TODO I need to see if I can simplify this logic, or perhaps split it into two functions: |
| 2964 | // one for non-prealloc traditional path, and one for incremental prealloc path. |
| 2966 | 2965 | const tracy = trace(@src()); |
| 2967 | 2966 | defer tracy.end(); |
| 2968 | 2967 | |
| ... | ... | @@ -3078,6 +3077,11 @@ fn parseObjectsIntoAtoms(self: *MachO) !void { |
| 3078 | 3077 | }; |
| 3079 | 3078 | if (!section_metadata.contains(match)) continue; |
| 3080 | 3079 | |
| 3080 | var base_vaddr = if (self.atoms.get(match)) |last| blk: { |
| 3081 | const last_atom_sym = self.locals.items[last.local_sym_index]; |
| 3082 | break :blk last_atom_sym.n_value + last.size; |
| 3083 | } else sect.addr; |
| 3084 | |
| 3081 | 3085 | if (self.atoms.getPtr(match)) |last| { |
| 3082 | 3086 | const first_atom = first_atoms.get(match).?; |
| 3083 | 3087 | last.*.next = first_atom; |
| ... | ... | @@ -3088,10 +3092,6 @@ fn parseObjectsIntoAtoms(self: *MachO) !void { |
| 3088 | 3092 | |
| 3089 | 3093 | if (!self.needs_prealloc) continue; |
| 3090 | 3094 | |
| 3091 | | var base_vaddr = if (self.atoms.get(match)) |last| blk: { |
| 3092 | | const last_atom_sym = self.locals.items[last.local_sym_index]; |
| 3093 | | break :blk last_atom_sym.n_value + last.size; |
| 3094 | | } else sect.addr; |
| 3095 | 3095 | const n_sect = @intCast(u8, self.section_ordinals.getIndex(match).? + 1); |
| 3096 | 3096 | |
| 3097 | 3097 | var atom = first_atoms.get(match).?; |