From a6b7187b460725540c180c762f22d10385e2017d Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 5 Mar 2020 10:21:08 -0800 Subject: [PATCH] Don't probe for A/W variants of entry points on non-Windows. --- src/coreclr/src/vm/method.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/method.cpp b/src/coreclr/src/vm/method.cpp index 9af4bb3759083..10d632e7584c2 100644 --- a/src/coreclr/src/vm/method.cpp +++ b/src/coreclr/src/vm/method.cpp @@ -5325,7 +5325,7 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const FARPROC pFunc = NULL; -#ifndef TARGET_UNIX +#ifdef TARGET_WINDOWS // Handle ordinals. if (funcName[0] == '#') { @@ -5334,10 +5334,14 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const } #endif - // Just look for the user-provided name without charset suffixes. If it is unicode fcn, we are going + // Just look for the user-provided name without charset suffixes. + // If we are targetting Windows and it is unicode fcn, we are going // to need to check for the 'W' API because it takes precedence over the // unmangled one (on NT some APIs have unmangled ANSI exports). pFunc = FindEntryPointWithMangling(hMod, funcName); +#ifndef TARGET_WINDOWS + return reinterpret_cast(pFunc); +#else if ((pFunc != NULL && IsNativeAnsi()) || IsNativeNoMangled()) { return reinterpret_cast(pFunc); @@ -5369,6 +5373,7 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const } return reinterpret_cast(pFunc); +#endif } #endif // CROSSGEN_COMPILE