Skip to content

Managed ilasm omits native exports and synthesized fixups for .export directives #137448

Closed

Description

@akoeplinger

Description

The managed ilasm package introduced by #137416 accepts the .export directives in the MixedMode AutoExports fixture but emits no native export directory. The resulting assembly also retains ILONLY, rather than synthesizing the mixed-mode export machinery. The existing native assembler emits an export directory for the same source and options.

This breaks MixedModeTests.AutoExports on Windows x86 and x64. @jkoritzinsky

Reproduction Steps

Use runtime.osx-arm64.Microsoft.NETCore.ILAsm version 12.0.0-alpha.1.26561.116 and the existing AutoExports.il fixture. It declares .export [8] on Triple and .export [7] as Twice on Double, without an explicit .vtfixup or .vtentry.

ilasm AutoExports.il -DLL -PE64 -X64 -OUTPUT=AutoExportsX64.dll

Inspect the resulting PE export directory, or run the existing MixedMode test on Windows x64. The x86 AutoExports fixture fails in CI as well.

The omission also reproduces with modern flags and without --pe64:

ilasm AutoExports.il --dll --x64 --output AutoExportsX64.dll

Expected behavior

Emit native exports named Twice and Triple, synthesize the necessary fixups/export stubs, and clear ILONLY as appropriate. Re-enable the AutoExports test once it can resolve and call both exports on Windows x86 and x64.

Actual behavior

The managed assembler succeeds, but the PE export directory RVA and size are both zero. The resulting image has CorFlags=0x1 (ILONLY).

Windows CI fails with:

System.EntryPointNotFoundException: Unable to find an entry point named 'Twice' in native library.
   at System.Runtime.InteropServices.NativeLibrary.GetSymbol(IntPtr handle, String symbolName, Boolean throwOnError)
   at MixedModeTests.FixupTables(Boolean autoExports)
   at MixedModeTests.AutoExports()

Regression?

Yes, relative to the existing native ilasm. A local comparison using the native assembler built from this runtime checkout produced a nonzero export directory (RVA 16400, size 40) with the original x64 options. The updated managed assembler produced no export directory for the same input.

Known Workarounds

Continue using native ilasm, or temporarily quarantine only MixedModeTests.AutoExports. No working managed-ilasm flag workaround was established.

Configuration

Managed ilasm package: 12.0.0-alpha.1.26561.116. Package repository commit: dotnet/dotnet@60864f1c9f7bc774d1c191ef6f1630e81607cd62.

PE output reproduced locally on macOS ARM64. Runtime failures observed on Windows x86 and x64 CoreCLR Checked. Windows execution was not performed locally.

Other information

Failing runtime build 1677882, test runs 46773032 (x86) and 46773498 (x64).

This is distinct from the nested-preprocessor assembly failure tracked by #137424; AutoExports assembles successfully but has incorrect output.

Note

This issue was generated by GitHub Copilot.

Activity

  1. added
    untriaged
    on Nov 12, 2026
  2. dotnet-policy-service commented on Nov 12, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
    See info in area-owners.md if you want to be subscribed.

  3. removed
    untriaged
    on Nov 18, 2026
  4. added a commit that references this issue on Nov 18, 2026
    0968772
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions