m_pPrivatePerfCounter_LoaderBytes = pPrivatePerfCounter_LoaderBytes;
m_Options = 0;
+
+#ifndef CROSSGEN_COMPILE
if (fMakeExecutable)
m_Options |= LHF_EXECUTABLE;
+#endif // CROSSGEN_COMPILE
+
if (fZeroInit)
m_Options |= LHF_ZEROINIT;
if (((pSection->Characteristics & VAL32(IMAGE_SCN_MEM_WRITE)) == 0))
{
DWORD dwNewProtection = PAGE_READWRITE;
-#ifdef FEATURE_PAL
+#if defined(FEATURE_PAL) && !defined(CROSSGEN_COMPILE)
if (((pSection->Characteristics & VAL32(IMAGE_SCN_MEM_EXECUTE)) != 0))
{
// On SELinux, we cannot change protection that doesn't have execute access rights
// to one that has it, so we need to set the protection to RWX instead of RW
dwNewProtection = PAGE_EXECUTE_READWRITE;
}
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !CROSSGEN_COMPILE
if (!ClrVirtualProtect(pWriteableRegion, cbWriteableRegion,
dwNewProtection, &dwOldProtection))
ThrowLastError();
}
_ASSERTE(dirSize == dirPos);
+#ifndef CROSSGEN_COMPILE
if (dwOldProtection != 0)
{
// Restore the protection
dwOldProtection, &dwOldProtection))
ThrowLastError();
}
+#endif // CROSSGEN_COMPILE
}
#endif // FEATURE_PREJIT
#else //!FEATURE_PAL
+#ifndef CROSSGEN_COMPILE
m_FileView = PAL_LOADLoadPEFile(hFile);
+
if (m_FileView == NULL)
{
// For CoreCLR, try to load all files via LoadLibrary first. If LoadLibrary did not work, retry using
SetRelocated();
}
+#else // !CROSSGEN_COMPILE
+ m_FileView = NULL;
+#endif // !CROSSGEN_COMPILE
+
#endif // !FEATURE_PAL
}