| ... | ... | @@ -81,7 +81,7 @@ pub fn resolveSymbols(self: *ZigModule, elf_file: *Elf) void { |
| 81 | 81 | if (esym.st_shndx == elf.SHN_UNDEF) continue; |
| 82 | 82 | |
| 83 | 83 | if (esym.st_shndx != elf.SHN_ABS and esym.st_shndx != elf.SHN_COMMON) { |
| 84 | | const atom_index = self.atoms.keys()[esym.st_shndx]; |
| 84 | const atom_index = esym.st_shndx; |
| 85 | 85 | const atom = elf_file.atom(atom_index) orelse continue; |
| 86 | 86 | if (!atom.alive) continue; |
| 87 | 87 | } |
| ... | ... | @@ -90,12 +90,17 @@ pub fn resolveSymbols(self: *ZigModule, elf_file: *Elf) void { |
| 90 | 90 | if (self.asFile().symbolRank(esym, false) < global.symbolRank(elf_file)) { |
| 91 | 91 | const atom_index = switch (esym.st_shndx) { |
| 92 | 92 | elf.SHN_ABS, elf.SHN_COMMON => 0, |
| 93 | | else => self.atoms.keys()[esym.st_shndx], |
| 93 | else => esym.st_shndx, |
| 94 | 94 | }; |
| 95 | const output_section_index = if (elf_file.atom(atom_index)) |atom| |
| 96 | atom.output_section_index |
| 97 | else |
| 98 | 0; |
| 95 | 99 | global.value = esym.st_value; |
| 96 | 100 | global.atom_index = atom_index; |
| 97 | 101 | global.esym_index = esym_index; |
| 98 | 102 | global.file_index = self.index; |
| 103 | global.output_section_index = output_section_index; |
| 99 | 104 | global.version_index = elf_file.default_sym_version; |
| 100 | 105 | if (esym.st_bind() == elf.STB_WEAK) global.flags.weak = true; |
| 101 | 106 | } |