authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-10-17 12:42:25+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-10-19 18:30:34+01:00
logcebeab2671e98de0d3c1d6677ebfa56c5e253077
treec948ed0f012e718b6785ee515638d8d2e442819a
parent5be6c62845638e6983b98f2c0c59d3a31a865b65
signature Commit is signed but in an unrecognized format.

Elf2: remove unhelpful TODOs

The whole linker suffers from this bug right now (where it naively assumes it will never itself trigger overflow of the address space), we don't need TODOs for it in one specific target machine's code path.

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

src/link/Elf2.zig-2
...@@ -12469,7 +12469,6 @@ fn ensurePltEntry(elf: *Elf, gsi: Symbol.Global.Index) Error!bool {...@@ -12469,7 +12469,6 @@ fn ensurePltEntry(elf: *Elf, gsi: Symbol.Global.Index) Error!bool {
1246912469
12470 // relocate the PLT entry to point to the .GOT.PLT entry12470 // relocate the PLT entry to point to the .GOT.PLT entry
12471 const got_plt_abs = got_plt_section.vaddr(elf) + got_plt_offset;12471 const got_plt_abs = got_plt_section.vaddr(elf) + got_plt_offset;
12472 // TODO: handle overflow gracefully
12473 const inst0: *align(1) link.loongarch.J20 = @ptrCast(plt_slice[0..4]);12472 const inst0: *align(1) link.loongarch.J20 = @ptrCast(plt_slice[0..4]);
12474 const inst1: *align(1) link.loongarch.K12 = @ptrCast(plt_slice[4..8]);12473 const inst1: *align(1) link.loongarch.K12 = @ptrCast(plt_slice[4..8]);
12475 elf.targetStore(inst0, .{12474 elf.targetStore(inst0, .{
...@@ -12635,7 +12634,6 @@ fn flushMovedPltSection(elf: *Elf, which: enum { plt, plt_sec, got_plt }, old_ad...@@ -12635,7 +12634,6 @@ fn flushMovedPltSection(elf: *Elf, which: enum { plt, plt_sec, got_plt }, old_ad
12635 const target_slice = plt_slice[plt_offset..];12634 const target_slice = plt_slice[plt_offset..];
1263612635
12637 const got_plt_abs: u64 = got_plt_addr + got_plt_offset;12636 const got_plt_abs: u64 = got_plt_addr + got_plt_offset;
12638 // TODO: handle overflow gracefully
12639 const inst0: *align(1) link.loongarch.J20 = @ptrCast(target_slice[0..4]);12637 const inst0: *align(1) link.loongarch.J20 = @ptrCast(target_slice[0..4]);
12640 const inst1: *align(1) link.loongarch.K12 = @ptrCast(target_slice[4..8]);12638 const inst1: *align(1) link.loongarch.K12 = @ptrCast(target_slice[4..8]);
1264112639