mirror of
https://github.com/ziglang/zig.git
synced 2025-12-28 17:13:19 +00:00
elf: fix a typo in setting atom name before it's been allocated
This commit is contained in:
parent
e0c475b6b7
commit
3f10217a47
@ -912,12 +912,13 @@ fn updateDeclCode(
|
||||
const sym = elf_file.symbol(sym_index);
|
||||
const esym = &self.local_esyms.items(.elf_sym)[sym.esym_index];
|
||||
const atom_ptr = sym.atom(elf_file).?;
|
||||
const name_offset = try self.strtab.insert(gpa, decl.fqn.toSlice(ip));
|
||||
|
||||
atom_ptr.alive = true;
|
||||
atom_ptr.name_offset = sym.name_offset;
|
||||
atom_ptr.name_offset = name_offset;
|
||||
atom_ptr.output_section_index = shdr_index;
|
||||
sym.name_offset = try self.strtab.insert(gpa, decl.fqn.toSlice(ip));
|
||||
esym.st_name = sym.name_offset;
|
||||
sym.name_offset = name_offset;
|
||||
esym.st_name = name_offset;
|
||||
esym.st_info |= stt_bits;
|
||||
esym.st_size = code.len;
|
||||
|
||||
@ -1009,15 +1010,17 @@ fn updateTlv(
|
||||
const sym = elf_file.symbol(sym_index);
|
||||
const esym = &self.local_esyms.items(.elf_sym)[sym.esym_index];
|
||||
const atom_ptr = sym.atom(elf_file).?;
|
||||
const name_offset = try self.strtab.insert(gpa, decl.fqn.toSlice(ip));
|
||||
|
||||
sym.value = 0;
|
||||
atom_ptr.output_section_index = shndx;
|
||||
sym.name_offset = name_offset;
|
||||
|
||||
sym.name_offset = try self.strtab.insert(gpa, decl.fqn.toSlice(ip));
|
||||
atom_ptr.output_section_index = shndx;
|
||||
atom_ptr.alive = true;
|
||||
atom_ptr.name_offset = sym.name_offset;
|
||||
atom_ptr.name_offset = name_offset;
|
||||
|
||||
esym.st_value = 0;
|
||||
esym.st_name = sym.name_offset;
|
||||
esym.st_name = name_offset;
|
||||
esym.st_info = elf.STT_TLS;
|
||||
esym.st_size = code.len;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user