[release/10.0] Fix assembly labels on MacOS X64 to be LOCAL_LABEL#129536
[release/10.0] Fix assembly labels on MacOS X64 to be LOCAL_LABEL#129536davidwrighton wants to merge 1 commit into
Conversation
Not doing this leads to the functions being carved up by the linker, which leads to incorrect behavior. (cherry picked from commit e09733c)
|
Tagging subscribers to this area: @agocke |
There was a problem hiding this comment.
Pull request overview
This PR backports #129531 to release/10.0, updating CoreCLR AMD64 assembly stubs so intra-function labels are emitted as local labels on macOS (via LOCAL_LABEL(...)). This prevents Mach-O’s .subsections_via_symbols behavior from treating internal labels as symbol boundaries that can cause linker “function carving” and incorrect runtime behavior.
Changes:
- Converted internal branch targets in
ResolveWorkerChainLookupAsmStubto useLOCAL_LABEL(...)for both label definitions and references. - Converted internal labels in
ClrRestoreNonvolatileContextWorkerto useLOCAL_LABEL(...)for both label definitions and references.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/vm/amd64/virtualcallstubamd64.S | Uses LOCAL_LABEL for internal loop/success/fail labels in the chain-lookup stub to avoid non-local Mach-O symbols. |
| src/coreclr/vm/amd64/Context.S | Uses LOCAL_LABEL for internal control-flow labels in the context-restore worker to avoid non-local Mach-O symbols. |
|
Hi, the code complete date for 10.0.10 (the July 2026 release) is 24 June. Make sure to merge this PR on that date at the latest (or explicitly let me know that I should merge it), or it won't make it into that release. As a reminder, if this is a product change, you also need Tactics approval before merging this PR (test-only or infra-only changes don't require Tactics approval). |
Backport of #129531 to release/10.0.
/cc @davidwrighton
Customer Impact
Without this fix, macOS x64 assembly labels can be emitted as ordinary symbols instead of local labels. That can let the linker carve up functions incorrectly, leading to incorrect runtime behavior.
Regression
No known recent regression; this fixes existing assembly label authoring for macOS x64.
Testing
This backport changes
src/coreclr/vm/amd64/Context.Sandsrc/coreclr/vm/amd64/virtualcallstubamd64.S. No new test was added because this is an assembly-label/linker-behavior fix. The source PR and this backport PR rely on CI coverage for the affected release branch.Risk
Low. The change is limited to converting internal assembly labels and branches to LOCAL_LABEL(...) in macOS x64 CoreCLR assembly code, preserving control flow while avoiding externally visible labels.
IMPORTANT: If this backport is for a servicing release, please verify that:
elease/X.0-staging, not
elease/X.0.
Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
Note
This PR description was generated by GitHub Copilot.