| ... | ... | @@ -933,7 +933,12 @@ fn updateTlv( |
| 933 | 933 | { |
| 934 | 934 | const gop = try self.tls_variables.getOrPut(gpa, atom_ptr.atom_index); |
| 935 | 935 | assert(!gop.found_existing); // TODO incremental updates |
| 936 | | gop.value_ptr.* = .{ .symbol_index = sym_index, .code = try gpa.dupe(u8, code) }; |
| 936 | gop.value_ptr.* = .{ .symbol_index = sym_index }; |
| 937 | |
| 938 | // We only store the data for the TLV if it's non-zerofill. |
| 939 | if (elf_file.shdrs.items[shndx].sh_type != elf.SHT_NOBITS) { |
| 940 | gop.value_ptr.code = try gpa.dupe(u8, code); |
| 941 | } |
| 937 | 942 | } |
| 938 | 943 | |
| 939 | 944 | { |
| ... | ... | @@ -1514,7 +1519,7 @@ const DeclMetadata = struct { |
| 1514 | 1519 | |
| 1515 | 1520 | const TlsVariable = struct { |
| 1516 | 1521 | symbol_index: Symbol.Index, |
| 1517 | | code: []const u8, |
| 1522 | code: []const u8 = &[0]u8{}, |
| 1518 | 1523 | |
| 1519 | 1524 | fn deinit(tlv: *TlsVariable, allocator: Allocator) void { |
| 1520 | 1525 | allocator.free(tlv.code); |