-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add custom default base address option to crossgen #25227
Conversation
| } | ||
| #endif // ENSURE_PRIMARY_STACK_SIZE | ||
|
|
||
| char* useDefaultBaseAddr = getenv("COMPlus_UseDefaultBaseAddr"); |
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.
This switch disables a OS security feature. We cannot have this config switch in the product.
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.
Could this be added under some #ifdef?
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.
Putting it under ifdef like FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION should be ok (similar to existing FEATURE_ENABLE_NO_RANGE_CHECKS).
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.
I've put setup and usage of this parameter under ifdef FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION
|
Could you please share some details on how you expect to use it? You have done a lot of work on converting pointers to relative pointers earlier. I would expect that it has equivalent benefit. |
|
We want to enable both optimizations on removal of relocations and support for default base address option in the same build of CoreCLR. This will allow to choose different approaches to removal of relocations in different scenarios. |
4670803 to
35af2b9
Compare
| W(" input assemblies\n") | ||
|
|
||
| #endif | ||
| W(" /BaseAddress <value> - Specifies base address to use for compilation.\n") |
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.
Could you please put this under the ifdef as well?
| fLargeVersionBubbleSwitch = true; | ||
| } | ||
| #endif | ||
| else if (MatchParameter(*argv, W("BaseAddress"))) |
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.
And this place (the rest of the plumbing can stay)
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.
Done
This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
…eDefaultBaseAddr=0x1 is setup. This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
35af2b9 to
944f761
Compare
* Add crossgen option to setup default base address for native image This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION. * Mmap native images at default base address if env variable COMPlus_UseDefaultBaseAddr=0x1 is setup. This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
|
Thanks! |
* Add crossgen option to setup default base address for native image This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION. * Mmap native images at default base address if env variable COMPlus_UseDefaultBaseAddr=0x1 is setup. This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
) * Add crossgen option to setup default base address for native image This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION. * Mmap native images at default base address if env variable COMPlus_UseDefaultBaseAddr=0x1 is setup. This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION. Commit migrated from dotnet/coreclr@86e600c
This PR allows to manually setup default base address option for native images during
crossgenAlso, env variable could be setup to enable/disable mapping of images at default base address.
cc @alpencolt @jkotas