From cebeab2671e98de0d3c1d6677ebfa56c5e253077 Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Sat, 17 Oct 2026 12:42:25 +0100 Subject: [PATCH] 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. --- src/link/Elf2.zig | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/link/Elf2.zig b/src/link/Elf2.zig index 9c494d906183c644cd45d1740d20d229e6adce82..cd911832b05903b1af2e204567a02bb4f1f6e3ff 100644 --- a/src/link/Elf2.zig +++ b/src/link/Elf2.zig @@ -12469,7 +12469,6 @@ fn ensurePltEntry(elf: *Elf, gsi: Symbol.Global.Index) Error!bool { // relocate the PLT entry to point to the .GOT.PLT entry const got_plt_abs = got_plt_section.vaddr(elf) + got_plt_offset; - // TODO: handle overflow gracefully const inst0: *align(1) link.loongarch.J20 = @ptrCast(plt_slice[0..4]); const inst1: *align(1) link.loongarch.K12 = @ptrCast(plt_slice[4..8]); elf.targetStore(inst0, .{ @@ -12635,7 +12634,6 @@ fn flushMovedPltSection(elf: *Elf, which: enum { plt, plt_sec, got_plt }, old_ad const target_slice = plt_slice[plt_offset..]; const got_plt_abs: u64 = got_plt_addr + got_plt_offset; - // TODO: handle overflow gracefully const inst0: *align(1) link.loongarch.J20 = @ptrCast(target_slice[0..4]); const inst1: *align(1) link.loongarch.K12 = @ptrCast(target_slice[4..8]); -- 2.54.0