X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-dl.c;h=43116130309eec7195e24a87f8d39e10e544dbce;hb=08a728d237965feb2bbd485f909998b17c0bbb11;hp=aa57e04a50ec92185fc5d54a045e518f4be98458;hpb=e097a98f3bd9082c7d03fa580b604c0228b4ad67;p=mono.git diff --git a/mono/utils/mono-dl.c b/mono/utils/mono-dl.c index aa57e04a50e..43116130309 100644 --- a/mono/utils/mono-dl.c +++ b/mono/utils/mono-dl.c @@ -6,6 +6,7 @@ * * Copyright 2001-2004 Ximian, Inc. * Copyright 2004-2009 Novell, Inc. + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include "config.h" #include "mono/utils/mono-dl.h" @@ -401,28 +402,35 @@ mono_dl_open_runtime_lib (const char* lib_name, int flags, char **error_msg) if (binl != -1) { char *base; char *resolvedname, *name; + char *baseparent = NULL; buf [binl] = 0; resolvedname = mono_path_resolve_symlinks (buf); base = g_path_get_dirname (resolvedname); name = g_strdup_printf ("%s/.libs", base); runtime_lib = try_load (lib_name, name, flags, error_msg); g_free (name); + if (!runtime_lib) + baseparent = g_path_get_dirname (base); if (!runtime_lib) { - char *newbase = g_path_get_dirname (base); - name = g_strdup_printf ("%s/lib", newbase); + name = g_strdup_printf ("%s/lib", baseparent); runtime_lib = try_load (lib_name, name, flags, error_msg); g_free (name); } #ifdef __MACH__ if (!runtime_lib) { - char *newbase = g_path_get_dirname (base); - name = g_strdup_printf ("%s/Libraries", newbase); + name = g_strdup_printf ("%s/Libraries", baseparent); runtime_lib = try_load (lib_name, name, flags, error_msg); g_free (name); } #endif + if (!runtime_lib) { + name = g_strdup_printf ("%s/profiler/.libs", baseparent); + runtime_lib = try_load (lib_name, name, flags, error_msg); + g_free (name); + } g_free (base); g_free (resolvedname); + g_free (baseparent); } if (!runtime_lib) runtime_lib = try_load (lib_name, NULL, flags, error_msg);