Skip to content

Commit

Permalink
Do not use ExecutableMemoryAllocator on 64 bit platforms if default b…
Browse files Browse the repository at this point in the history
…ase address usage is requested (#70563)
  • Loading branch information
gbalykov committed Jun 14, 2022
1 parent fb9be0a commit 261574b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/coreclr/pal/src/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,13 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
// more efficient code (by avoiding usage of jump stubs). Alignment to a 64 KB granularity should
// not be necessary (alignment to page size should be sufficient), but see
// ExecutableMemoryAllocator::AllocateMemory() for the reason why it is done.
loadedBase = ReserveMemoryFromExecutableAllocator(pThread, ALIGN_UP(reserveSize, VIRTUAL_64KB));

#ifdef FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION
if (!g_useDefaultBaseAddr)
#endif // FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION
{
loadedBase = ReserveMemoryFromExecutableAllocator(pThread, ALIGN_UP(reserveSize, VIRTUAL_64KB));
}
#endif // HOST_64BIT

if (loadedBase == NULL)
Expand Down

0 comments on commit 261574b

Please sign in to comment.