diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-27 01:48:26 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-27 01:48:26 -0700 |
| commit | 5c106fcaa5b9d0a3ebeb2e8cdca589129d6a7ebd (patch) | |
| tree | ba92c6a96c85fa56dd5201318266db0bf161fa09 /libc/stdlib/atexit.c | |
| parent | 94a144eabd1c7477e77e81e83aa04d43c8a79791 (diff) | |
| parent | 0ba91ed3ca9e7340a2c55303034c3378967e2327 (diff) | |
| download | bionic-5c106fcaa5b9d0a3ebeb2e8cdca589129d6a7ebd.zip bionic-5c106fcaa5b9d0a3ebeb2e8cdca589129d6a7ebd.tar.gz bionic-5c106fcaa5b9d0a3ebeb2e8cdca589129d6a7ebd.tar.bz2 | |
Merge change 1852 into donut
* changes:
Fix __eabi_atexit() implementation, as well as a bug in the BSD-originated __cxa_finalize() implementation This patch uses "#if ANDROID" instead of "#if 1" in the __cxa_finalize() fix
Diffstat (limited to 'libc/stdlib/atexit.c')
| -rw-r--r-- | libc/stdlib/atexit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c index 5bf82ba..4ba2177 100644 --- a/libc/stdlib/atexit.c +++ b/libc/stdlib/atexit.c @@ -147,10 +147,19 @@ __cxa_finalize(void *dso) p->fns[n].fn_ptr.cxa_func = NULL; mprotect(p, pgsize, PROT_READ); } +#if ANDROID + /* it looks like we should always call the function + * with an argument, even if dso is not NULL. Otherwise + * static destructors will not be called properly on + * the ARM. + */ + (*fn.fn_ptr.cxa_func)(fn.fn_arg); +#else /* !ANDROID */ if (dso != NULL) (*fn.fn_ptr.cxa_func)(fn.fn_arg); else (*fn.fn_ptr.std_func)(); +#endif /* !ANDROID */ } } |
