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

This commit is contained in:
Jacob Young
2024-12-14 23:19:29 -05:00
parent 6d97185bc6
commit a53a8ab25e

View File

@@ -419,6 +419,7 @@ pub const Section = struct {
} else {
const shdr = &elf_file.sections.items(.shdr)[atom.output_section_index];
shdr.sh_offset += len;
shdr.sh_size -= len;
atom.value = 0;
}
atom.size -= len;
@@ -428,7 +429,7 @@ pub const Section = struct {
else
&macho_file.sections.items(.header)[sec.index];
header.offset += @intCast(len);
header.size = sec.len;
header.size -= len;
}
}