Hide __atexit and remove __atexit_invalid.
Bug: 11156955
Change-Id: I8c72edee8ecb92b75a282384277253bae19f7455
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index c607206..05f2faa 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -37,7 +37,6 @@
#include "atexit.h"
#include "private/thread_private.h"
-int __atexit_invalid = 1;
struct atexit *__atexit;
/*
@@ -131,8 +130,6 @@
sizeof(p->fns[0]);
p->next = __atexit;
__atexit = p;
- if (__atexit_invalid)
- __atexit_invalid = 0;
}
fnp = &p->fns[p->ind++];
fnp->cxa_func = func;
@@ -159,8 +156,6 @@
int n, pgsize = getpagesize(), original_ind;
static int call_depth;
- if (__atexit_invalid)
- return;
_ATEXIT_LOCK();
call_depth++;
diff --git a/libc/stdlib/atexit.h b/libc/stdlib/atexit.h
index 2e88ad6..b530ade 100644
--- a/libc/stdlib/atexit.h
+++ b/libc/stdlib/atexit.h
@@ -45,8 +45,7 @@
__BEGIN_DECLS
-extern int __atexit_invalid;
-extern struct atexit *__atexit; /* points to head of LIFO stack */
+__LIBC_HIDDEN__ extern struct atexit *__atexit; /* points to head of LIFO stack */
int __cxa_atexit(void (*)(void *), void *, void *);
void __cxa_finalize(void *);