feat(relinker): support ordinal imports from routed DLLs #11
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!11
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/11/head"
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?
@Callimann8 on GitHub · 2026-11-21 11:44 UTC · original
Callimann8:claude/project-thread-q2c7z8→main· +139 −13 · 14 files · 1 commits · merged 2026-11-21 11:56 UTCWhat
Ordinal imports from a routed DLL failed at load, because AnyBox libraries export by name only.
<Name> @<ordinal>lines incore/libs/xdll/<name>/Ordinals.txt.cmake/LibraryMap.cmakevalidates them (identifier, 1–65535, no repeated name or ordinal).anybox_add_xdllgeneratesab_<name>.defwhen a library has ordinals:Forwards.deflines get their@<ordinal>, and pinned exports that are not forwarded are added asName @<ordinal>. Libraries withoutOrdinals.txtbuild exactly as before.LibraryOrdinalsData.inc.LibraryMapcarries it, andConvertrefuses an image that imports by ordinal from a routed library at an ordinal no library pins, naming each one (XGameRuntime.dll #5). Host, bundled and unknown DLLs are unaffected.gameinputpinsGameInputCreate @1, the ordinalGameInput.libimports it by (from the pendinggdk-inventorydebt entry, which this removes).stubgen.pypoints skipped ordinal imports atOrdinals.txt; CONTRIBUTING, AGENTS, ARCHITECTURE and BUILD mention the file.Tested
-DANYBOX_RELINKER_ONLY=ON: 21/21 CTest pass, including the newrelinker_ordinalcase (pinned ordinal is routed and stays an ordinal import; unpinned one is refused and named; unrouted DLL ordinals are ignored). The new case fails with theConvertchange reverted.python tools/check_conventions.py: ok.python tools/debt_fold.py --check: 4 fragments apply cleanly.objdump -p ab_gameinput.dllshows theGameInputCreateforwarder at ordinal 1. With a temporaryXGameRuntimeInitialize @7in xgameruntime,ab_xgameruntime.dllexports it at ordinal 7 (temporary file not committed). Bad lines (Foo @0, repeated ordinal) stop configure with a message.Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/relinker-ordinals.md@ordinalsyntax (Microsoft PE format and .def documentation); GameInputCreate ordinal 1 from the GDKGameInput.libinventory entry already in debt@Dark3581 on GitHub · 2026-11-21 11:55 UTC · original · approved these changes
Reviewed — looks good
Merging as it is. Clean design: libraries without
Ordinals.txtbuild exactly as before, and the relinker now fails at conversion instead of at load.What I ran
Head
2232497, based on currentmain(81a02cc). MinGW (WinLibs GCC 15.2 UCRT, Ninja, Release) on Windows 10, clean build directory.Results
relinker_ordinaltools/check_conventions.py,tools/debt_fold.py --checkab_gameinput.dllexportsobjdump -p:GameInputCreateforwarder at ordinal 1XAudio2_9.dllby ordinal is now refused withXAudio2_9.dll #1 (pin the export ...), wheremainconverted it silentlyFindings
Blocking
None.
Non-blocking
Ordinals.txtyet, sotools/import_audit.pystill reports a pinned ordinal import (for examplegameinput.dll!#1) asabsent, andstubgen.py --from-auditskips it. I'll teachtools/anybox_scan.pyto resolve#<ordinal>throughOrdinals.txtin a follow-up, together with pinningXAudio2Create @1for the title above.Not verified
The MSVC build locally (CI covers it) and running a converted title that imports by ordinal.
Thanks, this closes #5 neatly.