Bind two ordinary PE import slots in one jump-table translation #767
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#767
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@R0Y00 on GitHub · 2026-11-23 01:55 UTC · original
Why this advances the port
The switch translator can lift ordinary calls and tail jumps through an explicitly bound ordinary IAT slot (#572 and #655). A translation run accepts one slot. A program that needs two host providers on the same reachable path still stops at that boundary. This task extends a documented startup and ABI building block within #317.
Scope
Extend the existing binding interface to describe two distinct ordinary IAT slots, each with its own provider, name or ordinal, argument count and guaranteed return width. Keep the existing single-binding invocation working. Resolve each reachable call or tail jump against its actual slot and preserve the existing ABI and frame checks. Use source-built DLLs and a switch function with two distinguishable paths. One provider is an ordinary call and the other is reachable as a tail jump. Reuse the existing fixtures and host wrappers where possible.
Acceptance
devandrelease. Record any first diagnostic. Delay imports and dynamically selected targets stay outside this fixture.To claim, comment with the binding interface and fixture you intend to extend. Refs #317, #572 and #655.
@lukaslw-lab on GitHub · 2026-11-23 02:07 UTC · original
I'd like to take this.
Interface: make
--bind PROVIDER SYMBOLintools/cpu_switch_aot.pyrepeatable. With two bindings, the--link-name,--import-argumentsand--return-bytesafter each--bindbelong to it. A single--bindparses exactly as today. Each reached IAT slot is matched to the binding whose import it holds, throughresolve_import. A slot matching no binding or two bindings is rejected, and so is a binding that no call or tail jump uses.cpu_translation()gets an optional second binding. If you'd rather have a binding manifest like--bind-ranges, I can do that instead.Fixture: a new source-built switch fixture next to
import_calls, so the existing layout checks stay untouched. One path callscpu_tail_named_provider!mix3(3 args, 8 bytes) and the other tail-jumps to a second provider with a different return width. It is compared native against AOT on the argument trace, published result and returned bytes, plus the three rejection controls from the issue. The #655 controls are kept.Environment: Windows 10 Pro 22H2 (19045), VS 2026 / MSVC 19.52,
devandrelease. Delay imports and dynamic targets are out of scope.Refs #317, #572, #655.
@R0Y00 on GitHub · 2026-11-23 02:20 UTC · original
Please go ahead with repeatable
--bind PROVIDER SYMBOL. Keep the existing single-binding command unchanged. When two bindings select different IAT slots, verify each uses its own argument count and return-width contract, including the tail jump. Please keep the three rejection controls and add an argument-order check if the per-binding flags could otherwise be silently applied to the wrong binding.