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 {...@@ -3399,15 +3399,15 @@ pub fn writeMergeSections(self: *Elf) !void {
33993399
3400 for (self.merge_sections.items) |msec| {3400 for (self.merge_sections.items) |msec| {
3401 const shdr = self.shdrs.items[msec.output_section_index];3401 const shdr = self.shdrs.items[msec.output_section_index];
34023402 const size = math.cast(usize, shdr.sh_size) orelse return error.Overflow;
3403 try buffer.ensureTotalCapacity(shdr.sh_size);3403 try buffer.ensureTotalCapacity(size);
3404 buffer.appendNTimesAssumeCapacity(0, shdr.sh_size);3404 buffer.appendNTimesAssumeCapacity(0, size);
34053405
3406 for (msec.subsections.items) |msub_index| {3406 for (msec.subsections.items) |msub_index| {
3407 const msub = self.mergeSubsection(msub_index);3407 const msub = self.mergeSubsection(msub_index);
3408 assert(msub.alive);3408 assert(msub.alive);
3409 const string = msub.getString(self);3409 const string = msub.getString(self);
3410 const off: u64 = @intCast(msub.value);3410 const off = math.cast(usize, msub.value) orelse return error.Overflow;
3411 @memcpy(buffer.items[off..][0..string.len], string);3411 @memcpy(buffer.items[off..][0..string.len], string);
3412 }3412 }
34133413