Skip to content

fix(relinker): resolve all-zero dynamic symbols to null on Windows - #4602

Closed
pushkarreddyy wants to merge 1 commit into
boykopovar:mainfrom
pushkarreddyy:fix/relinker-empty-import-symbol
Closed

pushkarreddyy wants to merge 1 commit into
boykopovar:mainfrom
pushkarreddyy:fix/relinker-empty-import-symbol

Conversation

@pushkarreddyy

Copy link
Copy Markdown
Contributor

What

Fixes #4437. Unblocks OliSe Player (PPSA01153).

In OliSe Player (PPSA01153), the executable contains seven weak references pointing at dynamic symbol entries whose 24 bytes are all zero (no name, local, undefined, value 0). On Windows, WindowsRelocationBuilder::Apply threw FAIL: Empty import symbol name (offset 0x18c5bb8).

  • WindowsRelocationBuilder::Apply: when an import symbol name is empty, inspects the 24-byte symbol entry in dynamicSection.DynSymData. If the entire 24-byte entry is zero (unreferenced / weak null symbol), verifies addend (type != 1 && addend != 0 throws GLOB_DAT/JUMP_SLOT relocation has a nonzero addend), writes the null/addend pointer directly to the target location (image.RequireWritable(target, 8); image.WritePointer(target, addend);), and skips adding a PE import entry. Dynamic symbols with an empty name that have non-zero attributes still throw Empty import symbol name.
  • Documented in TechnicalDebt.md.

Tested

  • Added unit test cases in core/relinker/relinker/tests/test_windows_import_modules.py verifying both that an executable with an all-zero dynamic symbol entry resolves cleanly to null on Windows, and that a non-zero symbol with an empty name is rejected with Empty import symbol name.
  • python tools/check_conventions.py --base origin/main passed cleanly with 0 errors.

Checklist

@pushkarreddyy
pushkarreddyy force-pushed the fix/relinker-empty-import-symbol branch from 352e9d4 to 603fba8 Compare October 12, 2026 18:26
@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

I had this independently implemented and passing CI, but saw #4452 was merged into main just ahead of this. Closing in favor of #4452.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relinker (Windows): OliSe Player (PPSA01153) stops at 'Empty import symbol name' on seven weak references with all-zero symbol entries

1 participant