| ... | @@ -2091,7 +2091,7 @@ fn initHeaders( | ... | @@ -2091,7 +2091,7 @@ fn initHeaders( |
| 2091 | } | 2091 | } |
| 2092 | | 2092 | |
| 2093 | assert(elf.ni.shdr == try elf.mf.addLastChildNode(gpa, elf.ni.file, .{ | 2093 | assert(elf.ni.shdr == try elf.mf.addLastChildNode(gpa, elf.ni.file, .{ |
| 2094 | .size = elf.ehdrField(.shentsize) * elf.ehdrField(.shnum), | 2094 | .size = @as(u64, elf.ehdrField(.shentsize)) * @as(u64, elf.ehdrField(.shnum)), |
| 2095 | .alignment = elf.mf.flags.block_size, | 2095 | .alignment = elf.mf.flags.block_size, |
| 2096 | .moved = true, | 2096 | .moved = true, |
| 2097 | .resized = true, | 2097 | .resized = true, |
| ... | @@ -3076,7 +3076,7 @@ fn loadObject( | ... | @@ -3076,7 +3076,7 @@ fn loadObject( |
| 3076 | if (ehdr.machine != elf.ehdrField(.machine)) | 3076 | if (ehdr.machine != elf.ehdrField(.machine)) |
| 3077 | return diags.failParse(path, "bad machine", .{}); | 3077 | return diags.failParse(path, "bad machine", .{}); |
| 3078 | if (ehdr.shoff == 0 or ehdr.shnum <= 1) return; | 3078 | if (ehdr.shoff == 0 or ehdr.shnum <= 1) return; |
| 3079 | if (ehdr.shoff + ehdr.shentsize * ehdr.shnum > fl.size) | 3079 | if (ehdr.shoff + @as(u64, ehdr.shentsize) * @as(u64, ehdr.shnum) > fl.size) |
| 3080 | return diags.failParse(path, "bad section header location", .{}); | 3080 | return diags.failParse(path, "bad section header location", .{}); |
| 3081 | if (ehdr.shentsize < @sizeOf(ElfN.Shdr)) | 3081 | if (ehdr.shentsize < @sizeOf(ElfN.Shdr)) |
| 3082 | return diags.failParse(path, "unsupported shentsize", .{}); | 3082 | return diags.failParse(path, "unsupported shentsize", .{}); |
| ... | @@ -3638,7 +3638,7 @@ fn addSection(elf: *Elf, segment_ni: MappedFile.Node.Index, opts: struct { | ... | @@ -3638,7 +3638,7 @@ fn addSection(elf: *Elf, segment_ni: MappedFile.Node.Index, opts: struct { |
| 3638 | }, | 3638 | }, |
| 3639 | }; | 3639 | }; |
| 3640 | assert(shndx < @intFromEnum(Section.Index.LORESERVE)); | 3640 | assert(shndx < @intFromEnum(Section.Index.LORESERVE)); |
| 3641 | break :shndx .{ @enumFromInt(shndx), elf.targetLoad(&ehdr.shentsize) * shnum }; | 3641 | break :shndx .{ @enumFromInt(shndx), @as(u64, elf.targetLoad(&ehdr.shentsize)) * @as(u64, shnum) }; |
| 3642 | }, | 3642 | }, |
| 3643 | }; | 3643 | }; |
| 3644 | _, const shdr_node_size = elf.ni.shdr.location(&elf.mf).resolve(&elf.mf); | 3644 | _, const shdr_node_size = elf.ni.shdr.location(&elf.mf).resolve(&elf.mf); |