This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add custom default base address option to crossgen #25227
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add crossgen option to setup default base address for native image
This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
- Loading branch information
commit b8bd4c0dca9bc22af261491e6eb15d5d7d4e2c9b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ enum ReturnValues | |
| #define NumItems(s) (sizeof(s) / sizeof(s[0])) | ||
|
|
||
| STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzPlatformWinmdPaths, LPCWSTR pwzDiasymreaderPath); | ||
| STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr); | ||
| STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, SIZE_T customBaseAddress=0, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr); | ||
| void SetSvcLogger(ICorSvcLogger *pCorSvcLogger); | ||
| void SetMscorlibPath(LPCWSTR wzSystemDirectory); | ||
|
|
||
|
|
@@ -155,6 +155,9 @@ void PrintUsageHelper() | |
| W(" input assemblies\n") | ||
|
|
||
| #endif | ||
| #ifdef FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION | ||
| W(" /BaseAddress <value> - Specifies base address to use for compilation.\n") | ||
| #endif | ||
| #ifdef FEATURE_WINMD_RESILIENT | ||
| W(" WinMD Parameters\n") | ||
| W(" /WinMDResilient - Generate images resilient to WinMD dependency changes.\n") | ||
|
|
@@ -436,6 +439,7 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) | |
| LPCWSTR pwzOutputFilename = NULL; | ||
| LPCWSTR pwzPublicKeys = nullptr; | ||
| bool fLargeVersionBubbleSwitch = false; | ||
| SIZE_T baseAddress = 0; | ||
|
|
||
| #if !defined(FEATURE_MERGE_JIT_AND_ENGINE) | ||
| LPCWSTR pwszCLRJITPath = nullptr; | ||
|
|
@@ -543,6 +547,19 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) | |
| dwFlags |= NGENWORKER_FLAGS_LARGEVERSIONBUBBLE; | ||
| fLargeVersionBubbleSwitch = true; | ||
| } | ||
| #endif | ||
| #ifdef FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION | ||
| else if (MatchParameter(*argv, W("BaseAddress"))) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this place (the rest of the plumbing can stay)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| { | ||
| if (baseAddress != 0) | ||
| { | ||
| OutputErr(W("Cannot specify multiple base addresses.\n")); | ||
| exit(INVALID_ARGUMENTS); | ||
| } | ||
| baseAddress = (SIZE_T) _wcstoui64(argv[1], NULL, 0); | ||
| argv++; | ||
| argc--; | ||
| } | ||
| #endif | ||
| else if (MatchParameter(*argv, W("NoMetaData"))) | ||
| { | ||
|
|
@@ -942,6 +959,7 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) | |
| pwzPlatformResourceRoots, | ||
| pwzAppPaths, | ||
| pwzOutputFilename, | ||
| baseAddress, | ||
| pwzPlatformWinmdPaths | ||
| #if !defined(FEATURE_MERGE_JIT_AND_ENGINE) | ||
| , | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?