Skip to content

Fix assembly labels on MacOS X64 to be LOCAL_LABEL#129531

Merged
davidwrighton merged 1 commit into
dotnet:mainfrom
davidwrighton:fix_mac_x64_bug
Jun 18, 2026
Merged

Fix assembly labels on MacOS X64 to be LOCAL_LABEL#129531
davidwrighton merged 1 commit into
dotnet:mainfrom
davidwrighton:fix_mac_x64_bug

Conversation

@davidwrighton

Copy link
Copy Markdown
Member

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

Not doing this leads to the functions being carved up by the linker, which leads to incorrect behavior.
@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.

@janvorli

Copy link
Copy Markdown
Member

@davidwrighton what was the issue you were observing?

@davidwrighton

Copy link
Copy Markdown
Member Author

@janvorli this was the reason for ... #128955 The linker ended up doing something remarkable. It mangled the function order and inserted padding which consisted of incb [%rax] instructions .... but it happened to order the functions such that the next function was another part of the VSD dispatch logic (not the part which was next in the assembly file, the last part) and it would reliably actually successfully dispatch after making a small corruption of a chunk of the g_resolveCache structure (from running the padding logic). I'm rather flabbergasted that it worked as well as it did.

@janvorli

Copy link
Copy Markdown
Member

Oh, that's fun. Thanks for the details.

@janvorli janvorli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you!

@davidwrighton

Copy link
Copy Markdown
Member Author

/ba-g The only tests which have not passed are the Windows arm64 tests, and they won't pass due to an infra issue.

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