Skip to content

Commit

Permalink
[metadata] Skip symbol name mangling on non-Windows for netcore
Browse files Browse the repository at this point in the history
  • Loading branch information
CoffeeFlux committed Mar 23, 2020
1 parent 3a08f49 commit 0c1791a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mono/metadata/native-library.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
"Searching for '%s'.", import);

#if !defined(ENABLE_NETCORE) || defined(HOST_WIN32) // For netcore, name mangling is Windows-exclusive
if (piinfo->piflags & PINVOKE_ATTRIBUTE_NO_MANGLE)
error_msg = mono_dl_symbol (module, import, &addr);
else {
Expand Down Expand Up @@ -1380,6 +1381,9 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char
}
}
}
#else
error_msg = mono_dl_symbol (module, import, &addr);
#endif

*error_msg_out = error_msg;
return addr;
Expand Down

0 comments on commit 0c1791a

Please sign in to comment.