-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Align rva fields in reflection emit #63430
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
Align rva fields in reflection emit #63430
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-reflection-emit Issue DetailsIn support of CreateSpan (#60948), improve alignment for RVA static pre-initialized fields to align memory blocks which may contain long, ulong, or double primitive arrays on 8 byte boundaries. In Mono, the system will automatically align all RVA static data emitted via Reflection.Emit on 16 byte boundaries, so there is no fix needed. Fixes #62314
|
src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineInitializedData.cs
Show resolved
Hide resolved
- Enhance test case to verify that the RVA static actually has the pre-initialized data - Fix Ref-Emit generated RVA statics - Set the HasFieldRVA bit. NOTE: earlier code that attempts to set the bit doesn't actually do that as the FieldRVA bit is in FieldAttributes.ReservedMask which is masked away in the FieldBuilder constructor - Fix the Swizzle lookup. We should not be using the 8 byte swizzle in the final else clause. - Enhance ref-emitted field to allow for use with CreateSpan - Ref-emitted fields should specify a pack size appropriate for minimum alignment of the CreateSpan targetted data - Respect the packing_size specified so that RVA static fields generated for CreateSpan can be properly aligned
I like the approval, but now that I found the more significant issues to fix on Mono, I don't want a signoff without Mono involvement
|
@lambdageek Could you take a look. This fix has become substantially more complex in Mono. |
I'm off on sick time for a bit longer - I'll try to get to it. @vargaz could you take a look too |
|
The mono changes look ok to me. |
|
This fails on AOT platforms. @vargaz could you have a look at the failure? |
In support of CreateSpan (#60948), improve alignment for RVA static pre-initialized fields to align memory blocks which may contain long, ulong, or double primitive arrays on 8 byte boundaries.
Mono fix is more involved
Fixes #62314