mono_feature_disable_gac='yes'
mono_feature_disable_perfcounters='yes'
mono_feature_disable_attach='yes'
+ mono_feature_disable_dllmap='yes'
disable_mono_native=yes
support_boehm=no
elif test x$with_runtime_preset = xnet_4_x; then
AM_CONDITIONAL(ENABLE_STATIC_GCC_LIBS, test "x$enable_static_gcc_libs" = "xyes")
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
- LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
+ LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier, dllmap,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, interpreter, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
security, lldb, mdb, assert_messages, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac.],
[
AC_MSG_NOTICE([Disabled GAC support])
fi
+if test "x$mono_feature_disable_dllmap" = "xyes"; then
+ AC_DEFINE(DISABLE_DLLMAP,1,[Disables use of DllMaps in MonoVM])
+ AC_MSG_NOTICE([Disabled DllMap in the loader.])
+fi
+
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
typedef struct _MonoLoadedImages MonoLoadedImages;
typedef struct _MonoAssemblyLoadContext MonoAssemblyLoadContext;
+#ifndef DISABLE_DLLMAP
typedef struct _MonoDllMap MonoDllMap;
struct _MonoDllMap {
char *dll;
char *target_func;
MonoDllMap *next;
};
+#endif
#ifdef ENABLE_NETCORE
/* FIXME: this probably belongs somewhere else */
gpointer
mono_lookup_pinvoke_call_internal (MonoMethod *method, MonoError *error);
+#ifndef DISABLE_DLLMAP
void
mono_dllmap_insert_internal (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc);
void
mono_global_dllmap_cleanup (void);
+#endif
void
mono_cached_module_cleanup (void);
void
mono_loader_cleanup (void)
{
+#ifndef DISABLE_DLLMAP
mono_global_dllmap_cleanup ();
+#endif
mono_cached_module_cleanup ();
mono_native_tls_free (loader_lock_nest_id);
*/
void *user_info;
+#ifndef DISABLE_DLLMAP
/* dll map entries */
MonoDllMap *dll_map;
+#endif
/* interfaces IDs from this image */
/* protected by the classes lock */
return found;
}
+#ifndef DISABLE_DLLMAP
typedef struct {
char *dll;
char *target;
NULL, /* end */
dllmap_finish
};
+#endif
static void
legacyUEP_start (gpointer user_data,
{
inited = 1;
config_handlers = g_hash_table_new (g_str_hash, g_str_equal);
+#ifndef DISABLE_DLLMAP
g_hash_table_insert (config_handlers, (gpointer) dllmap_handler.element_name, (gpointer) &dllmap_handler);
+#endif
g_hash_table_insert (config_handlers, (gpointer) legacyUEP_handler.element_name, (gpointer) &legacyUEP_handler);
g_hash_table_insert (config_handlers, (gpointer) aot_cache_handler.element_name, (gpointer) &aot_cache_handler);
}
static char **pinvoke_search_directories;
#endif
+#ifndef DISABLE_DLLMAP
static MonoDllMap *global_dll_map;
+#endif
static GHashTable *global_module_map;
static MonoDl *internal_module;
GENERATE_GET_CLASS_WITH_CACHE (appdomain_unloaded_exception, "System", "AppDomainUnloadedException")
GENERATE_TRY_GET_CLASS_WITH_CACHE (appdomain_unloaded_exception, "System", "AppDomainUnloadedException")
-#ifndef ENABLE_NETCORE
+#ifndef DISABLE_DLLMAP
/*
* LOCKING: Assumes the relevant lock is held.
* For the global DllMap, this is `global_loader_data_mutex`, and for images it's their internal lock.
return res;
}
-#endif
static void
dllmap_insert_global (const char *dll, const char *func, const char *tdll, const char *tfunc)
dllmap_insert_image (assembly, dll, func, tdll, tfunc);
}
+void
+mono_global_dllmap_cleanup (void)
+{
+ // No need for a transition here since the thread is already detached from the runtime
+ mono_global_loader_data_lock ();
+
+ free_dllmap (global_dll_map);
+ global_dll_map = NULL;
+
+ mono_global_loader_data_unlock ();
+}
+#endif
+
/**
* mono_dllmap_insert:
* \param assembly if NULL, this is a global mapping, otherwise the remapping of the dynamic library will only apply to the specified assembly
void
mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc)
{
+#ifndef DISABLE_DLLMAP
mono_dllmap_insert_internal (assembly, dll, func, tdll, tfunc);
-}
-
-void
-mono_global_dllmap_cleanup (void)
-{
- // No need for a transition here since the thread is already detached from the runtime
- mono_global_loader_data_lock ();
-
- free_dllmap (global_dll_map);
- global_dll_map = NULL;
-
- mono_global_loader_data_unlock ();
+#endif
}
static MonoDl*
orig_scope = mono_metadata_string_heap (image, scope_token);
}
-#ifndef ENABLE_NETCORE
+#ifndef DISABLE_DLLMAP
// FIXME: The dllmap remaps System.Native to mono-native
mono_dllmap_lookup (image, orig_scope, orig_import, &new_scope, &new_import);
#else