commit 6a50a0f0ed3902b46afeda9c4a5b7f10cec60dba (tree)
parent f87a7251a3f9ae7259c64f458823117370071943
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Mon, 2 Sep 2024 08:58:49 +0200
elf: update osec index for section chunks in objects
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/link/Elf.zig b/src/link/Elf.zig
@@ -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];
}