authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2026-06-05 01:55:36-04:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2026-06-23 00:26:56-04:00
loge91a1060512be07e4da889f4baadd1588f77ad94
tree758ab8309d9bb0e238a3a5ff2f9d747cfb2ceb1d
parentbed106e5bf298adf8ce3f2c937f8fcaab14e21db

Coff: fixup not applying thunk target relocs


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

src/link/Coff.zig+2-5
...@@ -6223,13 +6223,12 @@ fn flushGlobal(coff: *Coff, gmi: Node.GlobalMapIndex) !bool {...@@ -6223,13 +6223,12 @@ fn flushGlobal(coff: *Coff, gmi: Node.GlobalMapIndex) !bool {
6223 return true;6223 return true;
6224 };6224 };
62256225
6226 const lib_name = import.lib_name.toSlice(coff);
6227
6228 try coff.nodes.ensureUnusedCapacity(gpa, 4);6226 try coff.nodes.ensureUnusedCapacity(gpa, 4);
6229 try coff.symbols.ensureUnusedCapacity(gpa, 2);6227 try coff.symbols.ensureUnusedCapacity(gpa, 2);
62306228
6231 const target_endian = coff.targetEndian();6229 const target_endian = coff.targetEndian();
6232 const addr_info = coff.targetAddrInfo();6230 const addr_info = coff.targetAddrInfo();
6231 const lib_name = import.lib_name.toSlice(coff);
6233 const gop = try coff.import_table.entries.getOrPutAdapted(6232 const gop = try coff.import_table.entries.getOrPutAdapted(
6234 gpa,6233 gpa,
6235 lib_name,6234 lib_name,
...@@ -6380,7 +6379,6 @@ fn flushGlobal(coff: *Coff, gmi: Node.GlobalMapIndex) !bool {...@@ -6380,7 +6379,6 @@ fn flushGlobal(coff: *Coff, gmi: Node.GlobalMapIndex) !bool {
6380 sym.section_number = iat_sym.section_number;6379 sym.section_number = iat_sym.section_number;
6381 sym.ni = iat_sym.ni;6380 sym.ni = iat_sym.ni;
6382 sym.setValue(.{ .node_offset = iat_offset });6381 sym.setValue(.{ .node_offset = iat_offset });
6383 si.flushMoved(coff);
6384 (try gop.value_ptr.import_address_table_symbols.addOne(gpa)).* = si;6382 (try gop.value_ptr.import_address_table_symbols.addOne(gpa)).* = si;
6385 },6383 },
6386 .thunk => {6384 .thunk => {
...@@ -6424,11 +6422,10 @@ fn flushGlobal(coff: *Coff, gmi: Node.GlobalMapIndex) !bool {...@@ -6424,11 +6422,10 @@ fn flushGlobal(coff: *Coff, gmi: Node.GlobalMapIndex) !bool {
6424 },6422 },
6425 }6423 }
6426 coff.nodes.appendAssumeCapacity(.{ .import_thunk = gmi });6424 coff.nodes.appendAssumeCapacity(.{ .import_thunk = gmi });
6427 sym.rva = coff.computeNodeRva(sym.ni);
6428 si.applyLocationRelocs(coff);
6429 },6425 },
6430 }6426 }
64316427
6428 si.flushMoved(coff);
6432 return true;6429 return true;
6433}6430}
64346431