authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-12-14 23:19:29-05:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-12-14 23:20:15-05:00
loga53a8ab25ef5138a0d72af3011c4dcc51bfa0caf
tree43e309e9ba52abdccacced5e1e01d9a4f6d02bd7
parent6d97185bc6aac388ee17df26674caf1a702c36f9

Elf: fix shdr size getting out of sync with the actual size


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

src/link/Dwarf.zig+2-1
......@@ -419,6 +419,7 @@ pub const Section = struct {
419419 } else {
420420 const shdr = &elf_file.sections.items(.shdr)[atom.output_section_index];
421421 shdr.sh_offset += len;
422 shdr.sh_size -= len;
422423 atom.value = 0;
423424 }
424425 atom.size -= len;
......@@ -428,7 +429,7 @@ pub const Section = struct {
428429 else
429430 &macho_file.sections.items(.header)[sec.index];
430431 header.offset += @intCast(len);
431 header.size = sec.len;
432 header.size -= len;
432433 }
433434 }
434435