PATCH: Mark __dso_handle hidden
H.J. Lu
hongjiu.lu@intel.com
Wed Jun 15 19:38:00 GMT 2011
Since __dso_handle is always hidden, we can optimize atexit by marking
__dso_handle hidden.
H.J.
---
2011-06-14 H.J. Lu <hongjiu.lu@intel.com>
* stdlib/atexit.c (__dso_handle): Remove weak and mark it hidden.
(atexit): Always pass __dso_handle to __cxa_atexit.
diff --git a/stdlib/atexit.c b/stdlib/atexit.c
index 256c5fc..973e095 100644
--- a/stdlib/atexit.c
+++ b/stdlib/atexit.c
@@ -38,8 +38,7 @@
/* This is defined by newer gcc version unique for each module. */
-extern void *__dso_handle __attribute__ ((__weak__));
-
+extern const void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
/* Register FUNC to be executed by `exit'. */
int
@@ -48,6 +47,5 @@ attribute_hidden
#endif
atexit (void (*func) (void))
{
- return __cxa_atexit ((void (*) (void *)) func, NULL,
- &__dso_handle == NULL ? NULL : __dso_handle);
+ return __cxa_atexit ((void (*) (void *)) func, NULL, __dso_handle);
}
More information about the Libc-alpha
mailing list