| ... | ... | @@ -3726,7 +3726,7 @@ pub fn updateDeclExports( |
| 3726 | 3726 | const i = if (self.globals_free_list.popOrNull()) |i| i else blk: { |
| 3727 | 3727 | _ = self.globals.addOneAssumeCapacity(); |
| 3728 | 3728 | self.export_info_dirty = true; |
| 3729 | | break :blk self.globals.items.len - 1; |
| 3729 | break :blk @intCast(u32, self.globals.items.len - 1); |
| 3730 | 3730 | }; |
| 3731 | 3731 | self.globals.items[i] = .{ |
| 3732 | 3732 | .n_strx = name_str_index, |
| ... | ... | @@ -3735,6 +3735,14 @@ pub fn updateDeclExports( |
| 3735 | 3735 | .n_desc = n_desc, |
| 3736 | 3736 | .n_value = decl_sym.n_value, |
| 3737 | 3737 | }; |
| 3738 | const resolv_name = try self.base.allocator.dupe(u8, exp_name); |
| 3739 | const resolv = try self.symbol_resolver.getOrPut(self.base.allocator, resolv_name); |
| 3740 | defer if (resolv.found_existing) self.base.allocator.free(resolv_name); |
| 3741 | resolv.value_ptr.* = .{ |
| 3742 | .where = .global, |
| 3743 | .where_index = i, |
| 3744 | .local_sym_index = decl.link.macho.local_sym_index, |
| 3745 | }; |
| 3738 | 3746 | |
| 3739 | 3747 | exp.link.macho.sym_index = @intCast(u32, i); |
| 3740 | 3748 | } |