Skip to content

Add ILASM MixedMode test coverage - #136347

Merged
MichalStrehovsky merged 2 commits into
dotnet:mainfrom
MichalStrehovsky:tests/ilasm-mixedmode-coverage
Nov 2, 2026
Merged

MichalStrehovsky merged 2 commits into
dotnet:mainfrom
MichalStrehovsky:tests/ilasm-mixedmode-coverage

Conversation

@MichalStrehovsky

@MichalStrehovsky MichalStrehovsky commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Cover explicit and synthesized vtable fixups, data-label pointers, and executable .data cil code on supported Windows architectures.

AI-assisted implementation generated with GitHub Copilot.

Cover explicit and synthesized vtable fixups, data-label pointers, and executable .data cil code on supported Windows architectures.

AI-assisted implementation generated with GitHub Copilot.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 92882451-9e34-43f4-ab91-c91996d5a709
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Use one AnyCPU driver with fixed x86, x64, and ARM64 helper assemblies. Share architecture definitions and select executable data bytes at assembly time.

AI-assisted implementation generated with GitHub Copilot.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 92882451-9e34-43f4-ab91-c91996d5a709
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jkoritzinsky

Copy link
Copy Markdown
Member

I was planning on not supporting .data cil in managed ilasm due to the same sections problem, but after some investigation it looks like we can just ignore the cil since everything ends up in .text. Though this means we do have a breaking change that .data goes into read-only memory with managed ilasm instead of read-write memory with native ilasm, which again falls into the "very expensive to fix and only used in practice in C++/CLI" bucket.

I'll put up a PR with an update to support .data cil and note the breaking change for managed ilasm.

@jkotas

jkotas commented Oct 23, 2026

Copy link
Copy Markdown
Member

Though this means we do have a breaking change that .data goes into read-only memory with managed ilasm instead of read-write memory with native ilasm

Why is that? We are able to place data with vtfixups into .sdata section. Why can't we place data without vtfixups there too?

@jkoritzinsky

Copy link
Copy Markdown
Member

At the time of commenting, I had forgotten that I implemented the sdata support. I've got a new PR up that adds the TLS support (since once we have sdata it's much more trivial). We can update that PR to always put the .data declarations that are not .data cil into .sdata instead of .text (I think that PR is doing that already, need to validate that).

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@jkoritzinsky could you have a look please?

@jkoritzinsky jkoritzinsky 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.

Looks good, still have one open question tho

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Looks good, still have one open question tho

You mean the question about .il section? I've not seen such section in the wild. Copilot says the native ilasm will create such section internally and then emit it as .text

@jkoritzinsky

Copy link
Copy Markdown
Member

Yeah I was trying to figure out where it merges that section in (I couldn't find it with a quick search). In any case, makes sense.

@MichalStrehovsky
MichalStrehovsky merged commit 0c48e4b into dotnet:main Nov 2, 2026
135 of 137 checks passed
@MichalStrehovsky
MichalStrehovsky deleted the tests/ilasm-mixedmode-coverage branch November 2, 2026 22:56
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
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