Repository navigation
Generate bionic thread-slot accesses in ARM64 rewrites - #3
Closed
thehobbit85 wants to merge 3 commits into
Closed
thehobbit85 wants to merge 3 commits into
thehobbit85 wants to merge 3 commits into
Conversation
Adapt the bionic TLS_SLOT_APP convention from the Android port (joaquinsandoval2307/nxnative at 1b2fc7b). Select it explicitly for each offline rewrite. Co-authored-by: Joaquin Sandoval <279042628+joaquinsandoval2307@users.noreply.github.com>
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The offline rewriter can now generate the bionic thread-slot accesses used by the Android port. Pass
--thread-slots androidtodm/tools/patch_nso.pyand use a separate output directory. Every generated slot lookup reads the host block through bionic's TLS slot. The fixups header identifies the layout to the loader.The default remains the Apple ABI. The Android option is for offline module preparation. A runnable Android app also needs the host gates, per-thread initialization and signal handling.
Checked
TP_SLOT=2, a different image, the same site table and 15,086 generated slot references.Stacked on #2. Its base is the Apple loader guard. Retarget to the fork's main after that guard merges.
Regression report
regress.py check (full): PASS
Baseline
codex/port-01-rewrite-abi09472c2, candidatecodex/port-02-android-rewriter50086de; Apple M2 Max, macOS 26.6, Xcode 27.0; 105.4 s0100F43008C44000LegendsZA
0100F43008C44000: PASS