diff options
Diffstat (limited to 'src/link/Elf')
| -rw-r--r-- | src/link/Elf/synthetic_sections.zig | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/link/Elf/synthetic_sections.zig b/src/link/Elf/synthetic_sections.zig index 47e72cb1e3..25a9975f01 100644 --- a/src/link/Elf/synthetic_sections.zig +++ b/src/link/Elf/synthetic_sections.zig @@ -917,8 +917,7 @@ pub const PltSection = struct { } pub fn writeSymtab(plt: PltSection, elf_file: *Elf) void { - var ilocal = plt.output_symtab_ctx.ilocal; - for (plt.symbols.items) |sym_index| { + for (plt.symbols.items, plt.output_symtab_ctx.ilocal..) |sym_index, ilocal| { const sym = elf_file.symbol(sym_index); const st_name = @as(u32, @intCast(elf_file.strtab.items.len)); elf_file.strtab.appendSliceAssumeCapacity(sym.name(elf_file)); @@ -932,7 +931,6 @@ pub const PltSection = struct { .st_value = sym.pltAddress(elf_file), .st_size = 16, }; - ilocal += 1; } } @@ -1046,8 +1044,7 @@ pub const PltGotSection = struct { } pub fn writeSymtab(plt_got: PltGotSection, elf_file: *Elf) void { - var ilocal = plt_got.output_symtab_ctx.ilocal; - for (plt_got.symbols.items) |sym_index| { + for (plt_got.symbols.items, plt_got.output_symtab_ctx.ilocal..) |sym_index, ilocal| { const sym = elf_file.symbol(sym_index); const st_name = @as(u32, @intCast(elf_file.strtab.items.len)); elf_file.strtab.appendSliceAssumeCapacity(sym.name(elf_file)); @@ -1061,7 +1058,6 @@ pub const PltGotSection = struct { .st_value = sym.pltGotAddress(elf_file), .st_size = 16, }; - ilocal += 1; } } }; |
