diff options
author | Steve MacLean <sdmaclea@qti.qualcomm.com> | 2017-05-03 14:24:21 -0400 |
---|---|---|
committer | Gaurav Khanna <gkhanna@microsoft.com> | 2017-05-03 11:24:21 -0700 |
commit | ef8d1522eb15cb0371f31a9392891c942547a91f (patch) | |
tree | 303d1116754e66eeb1c8edc3f686b6607ea1e2c9 /src/binder | |
parent | b16c8c73ce17c4ffb6189467def30c2e70f57a91 (diff) | |
download | coreclr-ef8d1522eb15cb0371f31a9392891c942547a91f.tar.gz coreclr-ef8d1522eb15cb0371f31a9392891c942547a91f.tar.bz2 coreclr-ef8d1522eb15cb0371f31a9392891c942547a91f.zip |
Fix Binder NI to IL fallback (#11341)
* Fix Binder NI to IL fallback
Always try NI first
* Fix Windows warning as error
* [Arm64/Unix] Revise PR per feedback
* More cleanup
Diffstat (limited to 'src/binder')
-rw-r--r-- | src/binder/assemblybinder.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/binder/assemblybinder.cpp b/src/binder/assemblybinder.cpp index bd5dd18cc9..1015b439a3 100644 --- a/src/binder/assemblybinder.cpp +++ b/src/binder/assemblybinder.cpp @@ -689,11 +689,11 @@ namespace BINDER_SPACE sCoreLib = sCoreLibDir; sCoreLib.Append(CoreLibName_IL_W); BOOL fExplicitBindToNativeImage = (fBindToNativeImage == true)? TRUE:FALSE; -#if defined(FEATURE_PAL) && !defined(_TARGET_AMD64_) - // Non-Amd64 platforms on non-Windows do not support generating the NI image - // as CoreLib.dll. For those, we will bind as IL. +#if defined(FEATURE_PAL) && !defined(_TARGET_AMD64_) && !defined(_TARGET_ARM64_) + // Some non-Windows platforms do not automatically generate the NI image as CoreLib.dll. + // If those platforms also do not support automatic fallback from NI to IL, bind as IL. fExplicitBindToNativeImage = FALSE; -#endif // defined(FEATURE_PAL) && !defined(_TARGET_AMD64_) +#endif // defined(FEATURE_PAL) && !defined(_TARGET_AMD64_) && !defined(_TARGET_ARM64_) IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib, FALSE /* fInspectionOnly */, TRUE /* fIsInGAC */, @@ -1596,8 +1596,13 @@ namespace BINDER_SPACE IF_FAIL_GO(BinderHasNativeHeader(pNativePEImage, &hasHeader)); if (!hasHeader) { - pPEImage = pNativePEImage; - pNativePEImage = NULL; + BinderReleasePEImage(pPEImage); + BinderReleasePEImage(pNativePEImage); + + BINDER_LOG_ENTER(W("BinderAcquirePEImageIL")); + hr = BinderAcquirePEImage(szAssemblyPath, &pPEImage, &pNativePEImage, false); + BINDER_LOG_LEAVE_HR(W("BinderAcquirePEImageIL"), hr); + IF_FAIL_GO(hr); } } |