Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't probe for A/W variants of entry points on non-Windows. #33250

Merged
merged 4 commits into from
Mar 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/coreclr/src/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] == '#')
{
Expand All @@ -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);
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
#ifndef TARGET_WINDOWS
return reinterpret_cast<LPVOID>(pFunc);
#else
if ((pFunc != NULL && IsNativeAnsi()) || IsNativeNoMangled())
{
return reinterpret_cast<LPVOID>(pFunc);
Expand Down Expand Up @@ -5369,6 +5373,7 @@ LPVOID NDirectMethodDesc::FindEntryPoint(NATIVE_LIBRARY_HANDLE hMod) const
}

return reinterpret_cast<LPVOID>(pFunc);
#endif
}
#endif // CROSSGEN_COMPILE

Expand Down