-/* $OpenBSD: crtbegin.c,v 1.16 2012/09/08 20:08:33 matthew Exp $ */
+/* $OpenBSD: crtbegin.c,v 1.17 2013/12/28 18:38:42 kettenis Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
__asm(".hidden __dso_handle");
long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
+
+extern int __cxa_atexit(void (*)(void *), void *, void *) __attribute__((weak));
+
+int
+atexit(void (*fn)(void))
+{
+ return (__cxa_atexit((void (*)(void *))fn, NULL, NULL));
+}
#endif
static const init_f __CTOR_LIST__[1]
-/* $OpenBSD: crtbeginS.c,v 1.13 2012/09/08 20:08:33 matthew Exp $ */
+/* $OpenBSD: crtbeginS.c,v 1.14 2013/12/28 18:38:42 kettenis Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
+extern int __cxa_atexit(void (*)(void *), void *, void *) __attribute__((weak));
extern void __cxa_finalize(void *) __attribute__((weak));
+
+int
+atexit(void (*fn)(void))
+{
+ return (__cxa_atexit((void (*)(void *))fn, NULL, &__dso_handle));
+}
+asm(".hidden atexit");
#endif
static init_f __CTOR_LIST__[1]
-/* $OpenBSD: crtbegin.c,v 1.16 2012/09/08 20:08:33 matthew Exp $ */
+/* $OpenBSD: crtbegin.c,v 1.17 2013/12/28 18:38:42 kettenis Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
__asm(".hidden __dso_handle");
long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
+
+extern int __cxa_atexit(void (*)(void *), void *, void *) __attribute__((weak));
+
+int
+atexit(void (*fn)(void))
+{
+ return (__cxa_atexit((void (*)(void *))fn, NULL, NULL));
+}
#endif
static const init_f __CTOR_LIST__[1]
-/* $OpenBSD: crtbeginS.c,v 1.13 2012/09/08 20:08:33 matthew Exp $ */
+/* $OpenBSD: crtbeginS.c,v 1.14 2013/12/28 18:38:42 kettenis Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
long __guard_local __dso_hidden __attribute__((section(".openbsd.randomdata")));
+extern int __cxa_atexit(void (*)(void *), void *, void *) __attribute__((weak));
extern void __cxa_finalize(void *) __attribute__((weak));
+
+int
+atexit(void (*fn)(void))
+{
+ return (__cxa_atexit((void (*)(void *))fn, NULL, &__dso_handle));
+}
+asm(".hidden atexit");
#endif
static init_f __CTOR_LIST__[1]
-major=72
+major=73
minor=0
# note: If changes were made to include/thread_private.h or if system
# calls were added/changed then librthread/shlib_version also be updated.
-/* $OpenBSD: atexit.c,v 1.16 2013/06/02 21:08:36 matthew Exp $ */
+/* $OpenBSD: atexit.c,v 1.17 2013/12/28 18:38:42 kettenis Exp $ */
/*
* Copyright (c) 2002 Daniel Hartmeier
* All rights reserved.
return (ret);
}
-/*
- * Register a function to be performed at exit.
- */
-int
-atexit(void (*func)(void))
-{
- return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
-}
-
/*
* Call all handlers registered with __cxa_atexit() for the shared
* object owning 'dso'.