elf: fix 32bit build

This commit is contained in:
Jakub Konka 2023-11-08 18:45:43 +01:00
parent 9bcb432a0e
commit 0299ed5036

View File

@ -5003,7 +5003,8 @@ fn writeSyntheticSectionsObject(self: *Elf) !void {
const shdr = self.shdrs.items[sec.shndx];
const num_relocs = @divExact(shdr.sh_size, shdr.sh_entsize);
const num_relocs = math.cast(usize, @divExact(shdr.sh_size, shdr.sh_entsize)) orelse
return error.Overflow;
var relocs = try std.ArrayList(elf.Elf64_Rela).initCapacity(gpa, num_relocs);
defer relocs.deinit();