This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Mark __dso_handle hidden


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);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]