+2011-03-07 Ivan Maidanski <ivmai@mail.ru>
+
+ * dyn_load.c (GC_init_dyld): Do not invoke
+ _dyld_bind_fully_image_containing_address() if GC_no_dls (as it is
+ not required to register the main data segment in that case).
+ * include/gc.h (GC_no_dls): Adjust the comment.
+
2011-03-07 Ivan Maidanski <ivmai@mail.ru>
* dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test
# ifdef NO_DYLD_BIND_FULLY_IMAGE
/* FIXME: What should we do in this case? */
# else
+ if (GC_no_dls) return; /* skip main data segment registration */
+
/* When the environment variable is set, the dynamic linker binds */
/* all undefined symbols the application needs at launch time. */
/* This includes function symbols that are normally bound lazily at */
GC_printf("Forcing full bind of GC code...\n");
# endif
/* FIXME: '_dyld_bind_fully_image_containing_address' is deprecated. */
- if (!_dyld_bind_fully_image_containing_address(
+ if (!_dyld_bind_fully_image_containing_address(
(unsigned long *)GC_malloc))
- ABORT("_dyld_bind_fully_image_containing_address failed");
+ ABORT("_dyld_bind_fully_image_containing_address failed");
}
# endif
}
/* Don't register dynamic library data segments. */
/* Wizards only. Should be used only if the */
/* application explicitly registers all roots. */
- /* In Microsoft Windows environments, this will */
- /* usually also prevent registration of the */
- /* main data segment as part of the root set. */
+ /* (In some environments like Microsoft Windows */
+ /* and Apple's Darwin, this may also prevent */
+ /* registration of the main data segment as part */
+ /* of the root set.) */
/* The setter and getter are unsynchronized. */
GC_API void GC_CALL GC_set_no_dls(int);
GC_API int GC_CALL GC_get_no_dls(void);