ARM: make CRT_LEGACY_WORKAROUND work as intended

To properly support legacy ARM shared libraries, libc.so needs
to export the symbols __dso_handle and atexit, even though
these are now supplied by the crt startup code.

This patch reshuffles the existing CRT_LEGACY_WORKAROUND
conditionally compiled code slightly so it works as the
original author likely intended.

Change-Id: Id6c0e94dc65b7928324a5f0bad7eba6eb2f464b9
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
This commit is contained in:
Ard Biesheuvel
2012-08-21 14:13:50 +02:00
parent 9dfaa63a1c
commit f3cfcd869d
7 changed files with 76 additions and 56 deletions

View File

@@ -104,17 +104,6 @@ unlock:
return (ret);
}
#ifdef CRT_LEGACY_WORKAROUND
/*
* Register a function to be performed at exit.
*/
int
atexit(void (*func)(void))
{
return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
}
#endif
/*
* Call all handlers registered with __cxa_atexit() for the shared
* object owning 'dso'.