]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
darwin-crt3.c (atexit): Pass &__dso_handle rather than NULL for dso parameter to...
authorGeoffrey Keating <geoffk@apple.com>
Wed, 5 Apr 2006 00:53:55 +0000 (00:53 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Wed, 5 Apr 2006 00:53:55 +0000 (00:53 +0000)
* config/darwin-crt3.c (atexit): Pass &__dso_handle rather than
NULL for dso parameter to atexit_common.

From-SVN: r112692

gcc/ChangeLog
gcc/config/darwin-crt3.c

index 3c2059ad6490b4a0249286e4961db48f555e3732..98a9a52de2b6adbcd85e8cced1a5ae3326a0fea6 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-04  Geoffrey Keating  <geoffk@apple.com>
+
+       * config/darwin-crt3.c (atexit): Pass &__dso_handle rather than
+       NULL for dso parameter to atexit_common.
+
 2006-04-04  Eric Christopher  <echristo@apple.com>
 
        * config/i386/i386.c (machopic_output_stub): Output \t
index 1cbb4b5fc2dac122e2af12185b47c8a88304d015..65b766369eeb7c24ecf30388e060a532d2b0ecd4 100644 (file)
@@ -518,11 +518,15 @@ __cxa_atexit (cxa_atexit_callback func, void* arg, const void* dso)
 
 int atexit (atexit_callback func) __attribute__((visibility("hidden")));
 
+/* Use __dso_handle to allow even bundles that call atexit() to be unloaded
+   on 10.4.  */
+extern void __dso_handle;
+
 int
 atexit (atexit_callback func)
 {
   struct one_atexit_routine r;
   r.callback.ac = func;
   r.has_arg = 0;
-  return atexit_common (&r, NULL);
+  return atexit_common (&r, &__dso_handle);
 }