-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Implement NoSEH flag setting for crossgened modules in ILLink #117779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement NoSEH flag setting for crossgened modules in ILLink #117779
Conversation
Fixes #117752 |
Co-authored-by: agocke <[email protected]>
Co-authored-by: agocke <[email protected]>
Please fix the compiler errors in the dotnet-linker-tests due to ambiguous namespaces |
Remove broad using statements for System.Reflection.Metadata and System.Reflection.PortableExecutable namespaces that were causing ambiguity with existing Individual test namespaces. Fully qualify the PE types to avoid conflicts. Co-authored-by: agocke <[email protected]>
Fixed the ambiguous namespace compiler errors by removing the broad using statements for |
@copilot in OutputStep.cs, there is a function called |
Co-authored-by: AaronRobinsonMSFT <[email protected]>
Updated the |
src/tools/illink/test/Mono.Linker.Tests.Cases/CommandLine/NoSEHFlagIsSet.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: AaronRobinsonMSFT <[email protected]>
There was a problem hiding this comment.
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 implements a fix to ensure the NoSEH (No Structured Exception Handling) flag is properly set in PE headers when ILLink processes crossgened assemblies. The change addresses issue #117752 by maintaining proper PE header compliance for these modules.
Key changes:
- Added NoSEH characteristic flag setting for crossgened modules in ILLink's output step
- Ensures PE header compliance alongside existing IL-only attributes
Thanks for pushing this along. I was trying to add a test case, but it was a pain to get R2R to run during ILLink testing. |
This PR implements the product fix to ensure the NoSEH flag is correctly set in the PE header when ILLink processes crossgened assemblies.
Fixes #117752
Changes Made
Product Fix:
WriteAssembly()
method inOutputStep.cs
to setmodule.Characteristics |= ModuleCharacteristics.NoSEH
when processing crossgened modulesTechnical Details
The implementation ensures that when a module is detected as crossgened (via
module.IsCrossgened()
), the NoSEH characteristic is added to indicate that the binary does not use Structured Exception Handling, which is important for proper PE header compliance.This addresses issue #117752 by providing the actual implementation to ensure ILLink maintains proper PE header characteristics for crossgened modules.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.