Skip to content

[release/10.0] Fix assembly labels on MacOS X64 to be LOCAL_LABEL#129536

Open
davidwrighton wants to merge 1 commit into
dotnet:release/10.0from
davidwrighton:backport/129531-net10
Open

[release/10.0] Fix assembly labels on MacOS X64 to be LOCAL_LABEL#129536
davidwrighton wants to merge 1 commit into
dotnet:release/10.0from
davidwrighton:backport/129531-net10

Conversation

@davidwrighton

@davidwrighton davidwrighton commented Jun 17, 2026

Copy link
Copy Markdown
Member

Backport of #129531 to release/10.0.

/cc @davidwrighton

Customer Impact

  • Customer reported
  • Found internally

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

  • Yes
  • No

No known recent regression; this fixes existing assembly label authoring for macOS x64.

Testing

This backport changes src/coreclr/vm/amd64/Context.S and src/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:

  • The PR target branch is
    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.

Not doing this leads to the functions being carved up by the linker, which leads to incorrect behavior.

(cherry picked from commit e09733c)
Copilot AI review requested due to automatic review settings June 17, 2026 19:23
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ResolveWorkerChainLookupAsmStub to use LOCAL_LABEL(...) for both label definitions and references.
  • Converted internal labels in ClrRestoreNonvolatileContextWorker to use LOCAL_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.

@svick

svick commented Jun 18, 2026

Copy link
Copy Markdown
Member

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).

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.

3 participants