Conversation
darwin arm64 executables become PIE LC_MAIN images (briar-systems/mach#1718, #1722). dyld enters an LC_MAIN program like main(argc, argv, envp) with the arguments in registers, not on the stack, so the entry captures argc/argv/envp from x0/x1/x2 instead of reading them off [sp]. raw svc 0x80 is retained; the x86_64 darwin entry is unchanged. Closes #324
darwin mkdirat is 475 (464 is openat_nocancel), unlinkat is 472, and faccessat is 466 - the previous 464/466/468 were wrong. these only surfaced once arm64 darwin binaries actually run (briar-systems/mach#1722): the native self-host build failed to create its object directory because mkdirat hit the wrong trap. Refs #324.
feat(runtime/darwin): arm64 entry via LC_MAIN register convention
release: v0.16.2
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.
Integration sweep of
dev→mainfor v0.16.2. No-fast-forward merge to preserve branching history.Contents (#324, via #325)
_startenters via the PIELC_MAINregister convention: captures argc/argv/envp from x0/x1/x2 as dyld hands them, instead of reading the stack.mkdirat(475),unlinkat(472),faccessat(466) syscall numbers (the prior 464/466/468 were wrong; 464 isopenat_nocancel).mach.toml0.16.1 → 0.16.2 + CHANGELOG (release: v0.16.2 #326).Notes
LC_MAIN, handing argc/argv/envp in registers — this_startreads them). mach consumes mach-std atbranch/main, so #1723's lock can point at amaincarrying this once merged here.v0.16.2is pushed separately after merge, not from this PR.