Skip to content

Commit e7fb47e

Browse files
authored
[metadata] Skip symbol name mangling on non-Windows for netcore (#33940)
Fixes #33246
1 parent 5369c71 commit e7fb47e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mono/mono/metadata/native-library.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char
12961296
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
12971297
"Searching for '%s'.", import);
12981298

1299+
#if !defined(ENABLE_NETCORE) || defined(HOST_WIN32) // For netcore, name mangling is Windows-exclusive
12991300
if (piinfo->piflags & PINVOKE_ATTRIBUTE_NO_MANGLE)
13001301
error_msg = mono_dl_symbol (module, import, &addr);
13011302
else {
@@ -1380,6 +1381,9 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char
13801381
}
13811382
}
13821383
}
1384+
#else
1385+
error_msg = mono_dl_symbol (module, import, &addr);
1386+
#endif
13831387

13841388
*error_msg_out = error_msg;
13851389
return addr;

0 commit comments

Comments
 (0)