| ... | ... | @@ -832,7 +832,6 @@ fn ElfFile(comptime is_64: bool) type { |
| 832 | 832 | const Elf_Shdr = if (is_64) elf.Elf64_Shdr else elf.Elf32_Shdr; |
| 833 | 833 | const Elf_Chdr = if (is_64) elf.Elf64_Chdr else elf.Elf32_Chdr; |
| 834 | 834 | const Elf_Sym = if (is_64) elf.Elf64_Sym else elf.Elf32_Sym; |
| 835 | | const Elf_Verdef = if (is_64) elf.Elf64_Verdef else elf.Elf32_Verdef; |
| 836 | 835 | const Elf_OffSize = if (is_64) elf.Elf64_Off else elf.Elf32_Off; |
| 837 | 836 | |
| 838 | 837 | return struct { |
| ... | ... | @@ -1179,10 +1178,13 @@ fn ElfFile(comptime is_64: bool) type { |
| 1179 | 1178 | const data = try allocator.alignedAlloc(u8, section_memory_align, src_data.len); |
| 1180 | 1179 | @memcpy(data, src_data); |
| 1181 | 1180 | |
| 1182 | | const defs = @as([*]Elf_Verdef, @ptrCast(data))[0 .. @as(usize, @intCast(src.sh_size)) / @sizeOf(Elf_Verdef)]; |
| 1181 | const defs = @as([*]elf.Verdef, @ptrCast(data))[0 .. @as(usize, @intCast(src.sh_size)) / @sizeOf(elf.Verdef)]; |
| 1183 | 1182 | for (defs) |*def| { |
| 1184 | | if (def.vd_ndx != elf.SHN_UNDEF) |
| 1185 | | def.vd_ndx = sections_update[src.sh_info].remap_idx; |
| 1183 | // Original author of this next line had elf.SHN_UNDEF |
| 1184 | // here which does not make sense given that this field |
| 1185 | // is elf.VER_NDX |
| 1186 | if (def.ndx != .LOCAL) |
| 1187 | def.ndx = @enumFromInt(sections_update[src.sh_info].remap_idx); |
| 1186 | 1188 | } |
| 1187 | 1189 | |
| 1188 | 1190 | break :dst_data data; |