aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-05 18:45:49 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-05 18:45:49 +0000
commit958d662bf8b1024f285ad27ce8d27ebee68bec30 (patch)
tree4a9af4d9d8496d32d055101536dbd44961e6218a
parent606ca8faa0015916d9003bdbbf0072d24c376fd2 (diff)
Radar 4502209
* config/darwin-crt3.c (atexit): Pass &__dso_handle rather than NULL for dso parameter to atexit_common. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@112716 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/darwin-crt3.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d321ec2bfb0..081234f2bae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2006-04-04 Geoffrey Keating <geoffk@apple.com>
+ Radar 4502209
+ * config/darwin-crt3.c (atexit): Pass &__dso_handle rather than
+ NULL for dso parameter to atexit_common.
+
Radar 4383613
* doc/extend.texi (Function Attributes): Rewrite visibility
attribute documentation.
diff --git a/gcc/config/darwin-crt3.c b/gcc/config/darwin-crt3.c
index c3091b91f5e..1bf00f1db2f 100644
--- a/gcc/config/darwin-crt3.c
+++ b/gcc/config/darwin-crt3.c
@@ -1,4 +1,4 @@
-/* APPLE LOCAL file 4484188 */
+/* APPLE LOCAL file mainline 2006-04-05 4484188 4383613 */
/* __cxa_atexit backwards-compatibility support for Darwin.
Copyright (C) 2006 Free Software Foundation, Inc.
@@ -521,13 +521,17 @@ __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);
}
/* APPLE LOCAL kext */
#endif /* __PIC__ */