From bbca3e37f34a7013d50c4badea5a156c87fd07ca Mon Sep 17 00:00:00 2001 From: ivmai Date: Mon, 7 Mar 2011 21:43:02 +0000 Subject: [PATCH] 2011-03-07 Ivan Maidanski * 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. --- ChangeLog | 7 +++++++ dyn_load.c | 6 ++++-- include/gc.h | 7 ++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30fbdd30..af983b9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-03-07 Ivan Maidanski + + * 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 * dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test diff --git a/dyn_load.c b/dyn_load.c index a15a8e22..49448a1d 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -1332,6 +1332,8 @@ GC_INNER void GC_init_dyld(void) # 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 */ @@ -1342,9 +1344,9 @@ GC_INNER void GC_init_dyld(void) 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 } diff --git a/include/gc.h b/include/gc.h index 1d6fb120..3f404b20 100644 --- a/include/gc.h +++ b/include/gc.h @@ -231,9 +231,10 @@ GC_API int GC_no_dls; /* 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); -- 2.40.0