about summary refs log tree commit diff
path: root/stdlib/atexit.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/atexit.c')
-rw-r--r--stdlib/atexit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/stdlib/atexit.c b/stdlib/atexit.c
index 256c5fcfc0..307662bdcd 100644
--- a/stdlib/atexit.c
+++ b/stdlib/atexit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1999, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -43,11 +43,14 @@ extern void *__dso_handle __attribute__ ((__weak__));
 
 /* Register FUNC to be executed by `exit'.  */
 int
-#ifndef atexit
-attribute_hidden
-#endif
 atexit (void (*func) (void))
 {
   return __cxa_atexit ((void (*) (void *)) func, NULL,
 		       &__dso_handle == NULL ? NULL : __dso_handle);
 }
+
+/* Hide the symbol so that no definition but the one locally in the
+   executable or DSO is used.  */
+#ifdef HAVE_DOT_HIDDEN
+asm (".hidden\tatexit");
+#endif