]> granicus.if.org Git - gc/commitdiff
2011-03-07 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Mon, 7 Mar 2011 21:43:02 +0000 (21:43 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:56 +0000 (21:06 +0400)
* 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
dyn_load.c
include/gc.h

index 30fbdd30d7003aa24be020b42e767e88f90ac533..af983b9c41b27cb7330731eab6f98ffa939471b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
index a15a8e22a496491303e4513bb1713b72dc13b993..49448a1d9265ebeb691b423509d6b8d3bba73bdd 100644 (file)
@@ -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
 }
index 1d6fb120ecfbbffdb0cd7d7d8c1c58a4f45c5aaf..3f404b207241d156accd10449501ee0e9b5262c5 100644 (file)
@@ -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);