From bc9b82c7818df986385f6d0e7e29b7ed801566f7 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 16:44:36 +0000 Subject: fix(jit): only alias __ImageBase when purely external LLJIT platform-support graphs define their own __ImageBase; aliasing it again duplicates the symbol and corrupts materialization. Skip those. Co-Authored-By: Claude Fable 5.1 --- tools/driver/EmbeddedRunner.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/driver/EmbeddedRunner.cc') diff --git a/tools/driver/EmbeddedRunner.cc b/tools/driver/EmbeddedRunner.cc index 2bb7e3b..ddfb608 100644 --- a/tools/driver/EmbeddedRunner.cc +++ b/tools/driver/EmbeddedRunner.cc @@ -149,6 +149,10 @@ public: // external __ImageBase to the lowest defined block once addresses // are final; a trailing zero block would push RVAs negative. Config.PostAllocationPasses.push_back([](LinkGraph &G) -> Error { + // LLJIT platform-support graphs define their own __ImageBase; + // only alias it when it is purely external (our module graph). + if (G.findDefinedSymbolByName(G.intern("__ImageBase"))) + return Error::success(); auto *ImageBaseExt = G.findExternalSymbolByName(G.intern("__ImageBase")); if (!ImageBaseExt) -- cgit v1.3.1-4-g156e