| ... | @@ -1305,6 +1305,18 @@ pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void { | ... | @@ -1305,6 +1305,18 @@ pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void { |
| 1305 | .offset = 0, | 1305 | .offset = 0, |
| 1306 | }); | 1306 | }); |
| 1307 | self.rebase_info_dirty = true; | 1307 | self.rebase_info_dirty = true; |
| | 1308 | |
| | 1309 | const sym = self.undef_symbols.items[fixup.symbol]; |
| | 1310 | const name_str = self.getString(sym.n_strx); |
| | 1311 | var name = try self.base.allocator.alloc(u8, name_str.len); |
| | 1312 | mem.copy(u8, name, name_str); |
| | 1313 | try self.lazy_binding_info_table.symbols.append(self.base.allocator, .{ |
| | 1314 | .segment = 3, |
| | 1315 | .offset = 0, |
| | 1316 | .dylib_ordinal = 1, |
| | 1317 | .name = name, |
| | 1318 | }); |
| | 1319 | self.lazy_binding_info_dirty = true; |
| 1308 | } | 1320 | } |
| 1309 | | 1321 | |
| 1310 | const text_section = text_segment.sections.items[self.text_section_index.?]; | 1322 | const text_section = text_segment.sections.items[self.text_section_index.?]; |
| ... | @@ -2078,6 +2090,17 @@ pub fn populateMissingMetadata(self: *MachO) !void { | ... | @@ -2078,6 +2090,17 @@ pub fn populateMissingMetadata(self: *MachO) !void { |
| 2078 | .n_desc = macho.REFERENCE_FLAG_UNDEFINED_NON_LAZY | macho.N_SYMBOL_RESOLVER, | 2090 | .n_desc = macho.REFERENCE_FLAG_UNDEFINED_NON_LAZY | macho.N_SYMBOL_RESOLVER, |
| 2079 | .n_value = 0, | 2091 | .n_value = 0, |
| 2080 | }); | 2092 | }); |
| | 2093 | |
| | 2094 | self.binding_info_table.dylib_ordinal = 1; |
| | 2095 | const nn = self.getString(name); |
| | 2096 | var n = try self.base.allocator.alloc(u8, nn.len); |
| | 2097 | mem.copy(u8, n, nn); |
| | 2098 | try self.binding_info_table.symbols.append(self.base.allocator, .{ |
| | 2099 | .name = n, |
| | 2100 | .segment = 2, |
| | 2101 | .offset = 0, |
| | 2102 | }); |
| | 2103 | self.binding_info_dirty = true; |
| 2081 | } | 2104 | } |
| 2082 | if (self.next_stub_helper_off == null) { | 2105 | if (self.next_stub_helper_off == null) { |
| 2083 | const text = &self.load_commands.items[self.text_segment_cmd_index.?].Segment; | 2106 | const text = &self.load_commands.items[self.text_segment_cmd_index.?].Segment; |