am 69dd152b: am 817e663d: am d715bffe: Merge "Fixed atexit()"

* commit '69dd152bc3bcba967e1e4620c839f1dacfe9c2b7':
  Fixed atexit()
This commit is contained in:
Andrew Hsieh
2015-03-20 22:01:52 +00:00
committed by Android Git Automerger
13 changed files with 76 additions and 21 deletions

View File

@@ -26,10 +26,20 @@
* SUCH DAMAGE.
*/
#include <stddef.h>
extern void* __dso_handle;
extern int __cxa_atexit(void (*)(void*), void*, void*);
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void))
{
return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
void __atexit_handler_wrapper(void* func) {
if (func != NULL) {
(*(void (*)(void))func)();
}
}
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void)) {
return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
}

View File

@@ -26,11 +26,20 @@
* SUCH DAMAGE.
*/
#include <stddef.h>
extern void* __dso_handle;
extern int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
extern int __cxa_atexit(void (*)(void*), void*, void*);
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void))
{
return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
void __atexit_handler_wrapper(void* func) {
if (func != NULL) {
(*(void (*)(void))func)();
}
}
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void)) {
return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
}

View File

@@ -26,10 +26,20 @@
* SUCH DAMAGE.
*/
#include <stddef.h>
extern void* __dso_handle;
extern int __cxa_atexit(void (*)(void*), void*, void*);
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void))
{
return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
void __atexit_handler_wrapper(void* func) {
if (func != NULL) {
(*(void (*)(void))func)();
}
}
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void)) {
return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
}

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/__dso_handle.h

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/__dso_handle_so.h

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/atexit.h

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/crtbegin_dynamic.c

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/crtbegin_so.c

View File

@@ -0,0 +1 @@
crtbegin_dynamic.c

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/crtend.S

View File

@@ -0,0 +1 @@
../../../android-3/arch-arm/src/crtend_so.S

View File

@@ -26,11 +26,20 @@
* SUCH DAMAGE.
*/
#include <stddef.h>
extern void* __dso_handle;
extern int __cxa_atexit(void (*)(void*), void*, void*);
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void)) {
return (__cxa_atexit((void (*)(void*)) func, (void*) 0, &__dso_handle));
void __atexit_handler_wrapper(void* func) {
if (func != NULL) {
(*(void (*)(void))func)();
}
}
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void)) {
return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
}

View File

@@ -26,11 +26,20 @@
* SUCH DAMAGE.
*/
#include <stddef.h>
extern void* __dso_handle;
extern int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
extern int __cxa_atexit(void (*)(void*), void*, void*);
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void))
{
return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
void __atexit_handler_wrapper(void* func) {
if (func != NULL) {
(*(void (*)(void))func)();
}
}
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void)) {
return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
}