Skip to content

Commit d9136d5

Browse files
author
Alex Rønne Petersen
committed
[monodroid] Load the Mono library with RTLD_GLOBAL.
This is needed so that libmono-profiler-log.so can resolve symbols against the Mono library that we're loading. This needs to be done now since we no longer link libmono-profiler-log.so with libmonosgen-2.0.so explicitly at build time.
1 parent 7010a35 commit d9136d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/monodroid/jni/dylib-mono.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ int monodroid_dylib_mono_init (struct DylibMono *mono_imports, const char *libmo
4141

4242
memset (mono_imports, 0, sizeof (*mono_imports));
4343

44-
mono_imports->dl_handle = dlopen (libmono_path, RTLD_LAZY);
44+
/*
45+
* We need to use RTLD_GLOBAL so that libmono-profiler-log.so can resolve
46+
* symbols against the Mono library we're loading.
47+
*/
48+
mono_imports->dl_handle = dlopen (libmono_path, RTLD_LAZY | RTLD_GLOBAL);
4549

4650
if (!mono_imports->dl_handle) {
4751
return FALSE;

0 commit comments

Comments
 (0)