authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-09-02 08:58:49+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-09-04 13:34:26+02:00
log6a50a0f0ed3902b46afeda9c4a5b7f10cec60dba
treed532ed7648285dbb0b7ffa9ad006c78e9064361a
parentf87a7251a3f9ae7259c64f458823117370071943

elf: update osec index for section chunks in objects


1 files changed, 7 insertions(+), 0 deletions(-)

src/link/Elf.zig+7
......@@ -3411,6 +3411,7 @@ fn shdrRank(self: *Elf, shndx: u32) u8 {
34113411 return 0xf9;
34123412 }
34133413 },
3414 elf.SHT_X86_64_UNWIND => return 0xf0,
34143415
34153416 elf.SHT_NOBITS => return if (flags & elf.SHF_TLS != 0) 0xf5 else 0xf7,
34163417 elf.SHT_SYMTAB => return 0xfa,
......@@ -3503,6 +3504,12 @@ fn resetShdrIndexes(self: *Elf, backlinks: []const u32) void {
35033504 }
35043505 }
35053506
3507 for (self.objects.items) |index| {
3508 for (self.file(index).?.object.section_chunks.items) |*chunk| {
3509 chunk.output_section_index = backlinks[chunk.output_section_index];
3510 }
3511 }
3512
35063513 for (self.comdat_group_sections.items) |*cg| {
35073514 cg.shndx = backlinks[cg.shndx];
35083515 }