elf: update osec index for section chunks in objects

This commit is contained in:
Jakub Konka 2024-09-02 08:58:49 +02:00
parent f87a7251a3
commit 6a50a0f0ed

View File

@ -3411,6 +3411,7 @@ fn shdrRank(self: *Elf, shndx: u32) u8 {
return 0xf9;
}
},
elf.SHT_X86_64_UNWIND => return 0xf0,
elf.SHT_NOBITS => return if (flags & elf.SHF_TLS != 0) 0xf5 else 0xf7,
elf.SHT_SYMTAB => return 0xfa,
@ -3503,6 +3504,12 @@ fn resetShdrIndexes(self: *Elf, backlinks: []const u32) void {
}
}
for (self.objects.items) |index| {
for (self.file(index).?.object.section_chunks.items) |*chunk| {
chunk.output_section_index = backlinks[chunk.output_section_index];
}
}
for (self.comdat_group_sections.items) |*cg| {
cg.shndx = backlinks[cg.shndx];
}