| ... | ... | @@ -8727,31 +8727,31 @@ fn updateExportInner( |
| 8727 | 8727 | }), |
| 8728 | 8728 | } |
| 8729 | 8729 | try elf.ensureUnusedSymbolCapacity(1, .maybe_global); |
| 8730 | | const exported_lsi: Symbol.LocalIndex, const @"type": std.elf.STT = switch (@"export".exported) { |
| 8731 | | .nav => |nav| .{ |
| 8732 | | (try elf.navMapIndex(zcu, nav)).symbol(elf), |
| 8733 | | elf.navType(ip.getNav(nav).resolved.?), |
| 8734 | | }, |
| 8735 | | .uav => |uav| .{ (try elf.uavMapIndex(uav, .none)).symbol(elf), .OBJECT }, |
| 8730 | const exported_lsi: Symbol.LocalIndex = switch (@"export".exported) { |
| 8731 | .nav => |nav| (try elf.navMapIndex(zcu, nav)).symbol(elf), |
| 8732 | .uav => |uav| (try elf.uavMapIndex(uav, .none)).symbol(elf), |
| 8736 | 8733 | }; |
| 8737 | 8734 | |
| 8738 | 8735 | try elf.ensureElfNodeSize(); |
| 8739 | | while (try elf.idle(pt.tid)) {} |
| 8740 | 8736 | |
| 8741 | | const value: u64 = Symbol.Id.local(exported_lsi).value(elf); |
| 8742 | | const size: u64, const shndx: Section.Index = switch (elf.symPtr(exported_lsi.index())) { |
| 8737 | // Initialize the global symbol with the same values that the local one currently has. If the |
| 8738 | // NAV/UAV is updated, then `updateNavInner` or `genUav` will update the global symbol sizes, |
| 8739 | // and `flushMoved` will update their values. |
| 8740 | const cur_value: u64, const cur_size: u64, const @"type": std.elf.STT, const shndx: Section.Index = switch (elf.symPtr(exported_lsi.index())) { |
| 8743 | 8741 | inline else => |exported_sym| .{ |
| 8742 | elf.targetLoad(&exported_sym.value), |
| 8744 | 8743 | elf.targetLoad(&exported_sym.size), |
| 8744 | elf.targetLoad(&exported_sym.info).type, |
| 8745 | 8745 | .fromSection(elf.targetLoad(&exported_sym.shndx)), |
| 8746 | 8746 | }, |
| 8747 | 8747 | }; |
| 8748 | 8748 | |
| 8749 | 8749 | const name = @"export".opts.name.toSlice(ip); |
| 8750 | 8750 | _ = elf.addGlobalSymbolAssumeCapacity(.{ |
| 8751 | | .node = .none, |
| 8751 | .node = exported_lsi.index().ptr(elf).node, |
| 8752 | 8752 | .name = try .string(elf, name), |
| 8753 | | .value = value, |
| 8754 | | .size = @intCast(size), |
| 8753 | .value = cur_value, |
| 8754 | .size = cur_size, |
| 8755 | 8755 | .type = @"type", |
| 8756 | 8756 | .bind = switch (@"export".opts.linkage) { |
| 8757 | 8757 | .strong => .strong, |