authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-18 17:25:28+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-18 17:25:28+02:00
log27d7ac88a3b433edb015541b61875a2588c17c26
tree4b086911f820c35f5abe4df3a752a1b85c8e1f54
parent52e0ca1312cac5fad5e941528d6c44f34985f537

elf: increase resolution of Atom.relocs_section_index to u32


2 files changed, 2 insertions(+), 2 deletions(-)

src/link/Elf/Atom.zig+1-1
...@@ -20,7 +20,7 @@ input_section_index: u16 = 0,...@@ -20,7 +20,7 @@ input_section_index: u16 = 0,
20output_section_index: u16 = 0,20output_section_index: u16 = 0,
2121
22/// Index of the input section containing this atom's relocs.22/// Index of the input section containing this atom's relocs.
23relocs_section_index: u16 = 0,23relocs_section_index: u32 = 0,
2424
25/// Index of this atom in the linker's atoms table.25/// Index of this atom in the linker's atoms table.
26atom_index: Index = 0,26atom_index: Index = 0,
src/link/Elf/ZigModule.zig+1-1
...@@ -73,7 +73,7 @@ pub fn addAtom(self: *ZigModule, elf_file: *Elf) !Symbol.Index {...@@ -73,7 +73,7 @@ pub fn addAtom(self: *ZigModule, elf_file: *Elf) !Symbol.Index {
73 esym.st_shndx = shndx;73 esym.st_shndx = shndx;
74 symbol_ptr.esym_index = esym_index;74 symbol_ptr.esym_index = esym_index;
7575
76 const relocs_index = @as(u16, @intCast(self.relocs.items.len));76 const relocs_index = @as(u32, @intCast(self.relocs.items.len));
77 const relocs = try self.relocs.addOne(gpa);77 const relocs = try self.relocs.addOne(gpa);
78 relocs.* = .{};78 relocs.* = .{};
79 atom_ptr.relocs_section_index = relocs_index;79 atom_ptr.relocs_section_index = relocs_index;