| ... | @@ -130,7 +130,10 @@ fn initAtoms(self: *Object, elf_file: *Elf) !void { | ... | @@ -130,7 +130,10 @@ fn initAtoms(self: *Object, elf_file: *Elf) !void { |
| 130 | continue; | 130 | continue; |
| 131 | } | 131 | } |
| 132 | | 132 | |
| 133 | const group_signature_off = try self.strings.insert(elf_file.base.allocator, group_signature); | 133 | // Note the assumption about a global strtab used here to disambiguate common |
| | 134 | // COMDAT owners. |
| | 135 | const gpa = elf_file.base.allocator; |
| | 136 | const group_signature_off = try elf_file.strtab.insert(gpa, group_signature); |
| 134 | const gop = try elf_file.getOrCreateComdatGroupOwner(group_signature_off); | 137 | const gop = try elf_file.getOrCreateComdatGroupOwner(group_signature_off); |
| 135 | const comdat_group_index = try elf_file.addComdatGroup(); | 138 | const comdat_group_index = try elf_file.addComdatGroup(); |
| 136 | const comdat_group = elf_file.comdatGroup(comdat_group_index); | 139 | const comdat_group = elf_file.comdatGroup(comdat_group_index); |
| ... | @@ -138,7 +141,7 @@ fn initAtoms(self: *Object, elf_file: *Elf) !void { | ... | @@ -138,7 +141,7 @@ fn initAtoms(self: *Object, elf_file: *Elf) !void { |
| 138 | .owner = gop.index, | 141 | .owner = gop.index, |
| 139 | .shndx = shndx, | 142 | .shndx = shndx, |
| 140 | }; | 143 | }; |
| 141 | try self.comdat_groups.append(elf_file.base.allocator, comdat_group_index); | 144 | try self.comdat_groups.append(gpa, comdat_group_index); |
| 142 | }, | 145 | }, |
| 143 | | 146 | |
| 144 | elf.SHT_SYMTAB_SHNDX => @panic("TODO SHT_SYMTAB_SHNDX"), | 147 | elf.SHT_SYMTAB_SHNDX => @panic("TODO SHT_SYMTAB_SHNDX"), |
| ... | @@ -184,7 +187,6 @@ fn addAtom( | ... | @@ -184,7 +187,6 @@ fn addAtom( |
| 184 | atom.name_offset = try elf_file.strtab.insert(elf_file.base.allocator, name); | 187 | atom.name_offset = try elf_file.strtab.insert(elf_file.base.allocator, name); |
| 185 | atom.file_index = self.index; | 188 | atom.file_index = self.index; |
| 186 | atom.input_section_index = shndx; | 189 | atom.input_section_index = shndx; |
| 187 | atom.flags.alive = true; | | |
| 188 | self.atoms.items[shndx] = atom_index; | 190 | self.atoms.items[shndx] = atom_index; |
| 189 | | 191 | |
| 190 | if (shdr.sh_flags & elf.SHF_COMPRESSED != 0) { | 192 | if (shdr.sh_flags & elf.SHF_COMPRESSED != 0) { |