diff options
author | David 'Digit' Turner <digit@google.com> | 2009-05-20 11:42:52 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-05-20 11:42:52 +0200 |
commit | 0ba91ed3ca9e7340a2c55303034c3378967e2327 (patch) | |
tree | a0d9e37c871decea29efca95bd0b6c292b4bfa93 /libc/bionic/eabi.c | |
parent | 8169573c8744ee3a484ea74bd5e06a8a4f708e37 (diff) | |
download | bionic-0ba91ed3ca9e7340a2c55303034c3378967e2327.zip bionic-0ba91ed3ca9e7340a2c55303034c3378967e2327.tar.gz bionic-0ba91ed3ca9e7340a2c55303034c3378967e2327.tar.bz2 |
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/bionic/eabi.c')
-rw-r--r-- | libc/bionic/eabi.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libc/bionic/eabi.c b/libc/bionic/eabi.c index 2e0c99c..a5f6627 100644 --- a/libc/bionic/eabi.c +++ b/libc/bionic/eabi.c @@ -32,13 +32,20 @@ extern int __cxa_atexit(void (*)(void*), void*, void* ); void* __dso_handle = 0; +/* The "C++ ABI for ARM" document states that static C++ constructors, + * which are called from the .init_array, should manually call + * __aeabi_atexit() to register static destructors explicitely. + * + * Note that 'dso_handle' is the address of a magic linker-generate + * variable from the shared object that contains the constructor/destructor + */ + /* Make this a weak symbol to avoid a multiple definition error when linking * with libstdc++-v3. */ int __attribute__((weak)) __aeabi_atexit (void *object, void (*destructor) (void *), void *dso_handle) { - return 0; - //return __cxa_atexit(destructor, object, dso_handle); + return __cxa_atexit(destructor, object, dso_handle); } |