From 20a6c049f93e14e9c4faaa9d66e657732f86adb3 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 18 Oct 2026 08:30:39 +0000 Subject: fix(driver): normalize MinGW unwind COMDATs before JIT linking Associate symbol-less MinGW unwind sections with their code before graph construction, including objects loaded from runtime archives. Handle suffixed unwind sections in personality stubs and SEH table registration. Co-Authored-By: Claude Opus 5.5 --- AGENTS/ARCH.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'AGENTS') diff --git a/AGENTS/ARCH.md b/AGENTS/ARCH.md index eb55466..2408179 100644 --- a/AGENTS/ARCH.md +++ b/AGENTS/ARCH.md @@ -139,14 +139,18 @@ Driver behavior (`tools/driver/main.cc`): the generic LLVM IR platform with EH-frame registration. macOS uses LLJIT's unwind registration, selecting compact unwind or EH-frame per host capability. Windows x86_64 keeps the GNU C++ runtime and `__gxx_personality_seh0` with a - small in-process COFF adapter: per-graph `__ImageBase` shared by relocations - and SEH registration, default backend liveness for `.pdata`, JITLink + small in-process COFF adapter: `MinGWCOFF.h` normalizes symbol-less MinGW + `.pdata$NAME`/`.xdata$NAME` COMDATs to associative COMDATs of `.text$NAME` + in private object-buffer copies before graph construction, including lazy + runtime archive members. Per-graph `__ImageBase` is shared by relocations + and SEH registration, with default backend liveness for `.pdata` and + associative code edges retaining the suffixed unwind sections. JITLink uses pointer-jump stubs for external direct CALL/JMP PCRel32 references in user - objects and `.xdata` personality references (shared per target; data references - are preserved), and + objects and `.xdata`/`.xdata$NAME` personality references (shared per target; + data references are preserved), and `RtlAddFunctionTable`/`RtlDeleteFunctionTable` via JITLink allocation actions - covering teardown and link-failure cleanup, with table validation in the - registration callback; registration failure blocks entry. + for `.pdata` and `.pdata$NAME`, covering teardown and link-failure cleanup, + with table validation in the registration callback; registration failure blocks entry. The JIT builds its `ObjectLinkingLayer` through one file-local factory (COFF flags stay format-conditional, SEH plugin installed before LLJIT ownership) so Windows COFF does not fall back -- cgit v1.3.1-4-g156e