authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-04-21 00:27:16+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-04-21 00:27:16+02:00
logda55af1cae6065be5313946ec4c9acd465bb04ad
tree64a40bb5f35f94fb4f55e0be7c6187ea7636bea6
parentbc46a4d51e8e95a0c0b9b7766c240d5d9d774941

link/elf: fix 32bit build


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

src/link/Elf.zig+4-4
......@@ -3399,15 +3399,15 @@ pub fn writeMergeSections(self: *Elf) !void {
33993399
34003400 for (self.merge_sections.items) |msec| {
34013401 const shdr = self.shdrs.items[msec.output_section_index];
3402
3403 try buffer.ensureTotalCapacity(shdr.sh_size);
3404 buffer.appendNTimesAssumeCapacity(0, shdr.sh_size);
3402 const size = math.cast(usize, shdr.sh_size) orelse return error.Overflow;
3403 try buffer.ensureTotalCapacity(size);
3404 buffer.appendNTimesAssumeCapacity(0, size);
34053405
34063406 for (msec.subsections.items) |msub_index| {
34073407 const msub = self.mergeSubsection(msub_index);
34083408 assert(msub.alive);
34093409 const string = msub.getString(self);
3410 const off: u64 = @intCast(msub.value);
3410 const off = math.cast(usize, msub.value) orelse return error.Overflow;
34113411 @memcpy(buffer.items[off..][0..string.len], string);
34123412 }
34133413