diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 16:51:01 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 16:51:01 +0000 |
| commit | 8f8aee7d7a3c6b100be5f43ae7998bd98ef49a75 (patch) | |
| tree | 96e61b731ecd7ebde10427c1980318c520e98705 /tools | |
| parent | 5a8dbb7b4a0e1a457a084f6c20d17ce2232be2e9 (diff) | |
fix(jit): scope the __ImageBase alias to its own graph
Module and platform graphs each need their own base for 32-bit
image-relative unwind addresses. A graph-local alias keeps the shared
name from colliding at materialization time.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/driver/EmbeddedRunner.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tools/driver/EmbeddedRunner.cc b/tools/driver/EmbeddedRunner.cc index d6d58db..b8c291a 100644 --- a/tools/driver/EmbeddedRunner.cc +++ b/tools/driver/EmbeddedRunner.cc @@ -149,21 +149,14 @@ 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). + // A graph-local alias never collides at materialization time, + // no matter how many graphs define the same base name. if (G.findDefinedSymbolByName(G.intern("__ImageBase"))) return Error::success(); auto *ImageBaseExt = G.findExternalSymbolByName(G.intern("__ImageBase")); if (!ImageBaseExt) return Error::success(); - // Platform graphs carry LLJIT-internal symbols; leave their - // own base alone or materialization sees it twice. - if (G.findDefinedSymbolByName( - G.intern("__lljit.platform_support_instance")) || - G.findExternalSymbolByName( - G.intern("__lljit.platform_support_instance"))) - return Error::success(); jitlink::Block *Low = nullptr; for (auto &Sec : G.sections()) { for (auto *B : Sec.blocks()) { @@ -175,7 +168,7 @@ public: return make_error<JITLinkError>( "missing embedded __ImageBase content"); G.makeDefined(*ImageBaseExt, *Low, 0, 8, Linkage::Strong, - Scope::Default, true); + Scope::Local, true); return Error::success(); }); |
