Repository navigation
Support TLS data sections in managed ilasm - #136404
Conversation
Preserve data section kinds through parsing and patch field RVAs, data references, and native artifacts after section layout. Emit TLS directories and relocations while retaining CIL data in .text. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib |
Select the custom PE builder for non-CIL data declarations and reserve the standard builder for CIL-only data without native fixups. Keep regular data in .sdata and update section-placement coverage. Co-authored-by: Copilot App <[email protected]>
MichalStrehovsky
left a comment
There was a problem hiding this comment.
We should also undo the rewrite of IL tests to C++/CLI so that we have real E2E coverage. I've not looked at the tests, but I'm pretty sure this is just testing how the AI thought this should operate but we need coverage that it actually works.
Consolidate section patching and debug-directory handling into ILAssemblerPEBuilder. Match native flag-pair semantics for TLS, data references, exports, and Prefer32Bit, while preserving flags for vtable-only images. Co-authored-by: Copilot App <[email protected]>
Replace string discriminators with ImageKind in the theory data and source-selection switch. Co-authored-by: Copilot App <[email protected]>
I'll try to add new IL tests. The C++/CLI tests continue to be more interesting for me as they're the real customer scenario. It should be possible to construct IL tests that will work (I think I can make it work with a netstandard or mscorlib core library). |
Is C++/CLI with disabled optimizations really the most interesting real customer scenario? |
|
Yes. The only supported way to use this feature is C++/CLI. We only disable optimizations so we can validate load and store instructions in a simple manner. I'm fine enabling optimizations, but I was making sure to match the IL instructions from the previous non-working tests. |
|
/ba-g BA stuck |
Managed ilasm rejects
.data tlsdeclarations and currently moves.data cilinto.sdatawhen emitting vtable fixups. Preserve each declaration's section so TLS data can be emitted correctly and CIL data stays in.text..tlsdata with a TLS directory, writable index, empty callback list, architecture-appropriate relocations, and the required COR flags..data cilin.text, including images containing vtable fixups and TLS data.Validation
.\.dotnet\dotnet.exe test src\tools\ilasm\tests\ILAssembler.Tests\ILAssembler.Tests.csproj --no-restore- passed: 5,425 tests, 3 existing platform-specific skips..\.dotnet\dotnet.exe test src\tools\ilasm\tests\ILAssembler.Tests\ILAssembler.Tests.csproj --no-restore -c Release- passed: 5,425 tests, 3 existing platform-specific skips.The new TLS/CIL regression cases failed against the original implementation. Coverage checks x86, x64, and ARM64 PE output, mixed data sections, TLS directories and relocations, cross-section references, exports, large data blocks, and empty declarations.
Note
This pull request was created with GitHub Copilot; its code and description include AI-generated content.