authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-21 11:44:03-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:12-07:00
logc911de825b3b9932e84345f6cec910553b21e203
tree8054401843d268000050d24d041f1962db11d574
parent4f4ddf5ef2f2e2ee2774e0a5311b099ea19d9ce2

link.Elf: keep the logic for updates but condition on hcs


1 files changed, 2 insertions(+), 2 deletions(-)

src/link/Elf.zig+2-2
...@@ -2166,7 +2166,7 @@ fn allocateAtom(self: *Elf, atom_index: Atom.Index, new_block_size: u64, alignme...@@ -2166,7 +2166,7 @@ fn allocateAtom(self: *Elf, atom_index: Atom.Index, new_block_size: u64, alignme
2166 // First we look for an appropriately sized free list node.2166 // First we look for an appropriately sized free list node.
2167 // The list is unordered. We'll just take the first thing that works.2167 // The list is unordered. We'll just take the first thing that works.
2168 const vaddr = blk: {2168 const vaddr = blk: {
2169 var i: usize = 0;2169 var i: usize = if (self.base.child_pid == null) 0 else free_list.items.len;
2170 while (i < free_list.items.len) {2170 while (i < free_list.items.len) {
2171 const big_atom_index = free_list.items[i];2171 const big_atom_index = free_list.items[i];
2172 const big_atom = self.getAtom(big_atom_index);2172 const big_atom = self.getAtom(big_atom_index);
...@@ -2397,7 +2397,7 @@ fn updateDeclCode(self: *Elf, decl_index: Module.Decl.Index, code: []const u8, s...@@ -2397,7 +2397,7 @@ fn updateDeclCode(self: *Elf, decl_index: Module.Decl.Index, code: []const u8, s
2397 const atom = self.getAtom(atom_index);2397 const atom = self.getAtom(atom_index);
23982398
2399 const shdr_index = decl_metadata.shdr;2399 const shdr_index = decl_metadata.shdr;
2400 if (atom.getSymbol(self).st_size != 0) {2400 if (atom.getSymbol(self).st_size != 0 and self.base.child_pid == null) {
2401 const local_sym = atom.getSymbolPtr(self);2401 const local_sym = atom.getSymbolPtr(self);
2402 local_sym.st_name = try self.shstrtab.insert(gpa, decl_name);2402 local_sym.st_name = try self.shstrtab.insert(gpa, decl_name);
2403 local_sym.st_info = (elf.STB_LOCAL << 4) | stt_bits;2403 local_sym.st_info = (elf.STB_LOCAL << 4) | stt_bits;