From 42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 7 Feb 2013 10:14:39 -0800 Subject: Clean up the argc/argv/envp/auxv handling. There's now only one place where we deal with this stuff, it only needs to be parsed once by the dynamic linker (rather than by each recipient), and it's now easier for us to get hold of auxv data early on. Change-Id: I6314224257c736547aac2e2a650e66f2ea53bef5 --- libc/bionic/libc_init_common.h | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'libc/bionic/libc_init_common.h') diff --git a/libc/bionic/libc_init_common.h b/libc/bionic/libc_init_common.h index c55594b98..23ac30554 100644 --- a/libc/bionic/libc_init_common.h +++ b/libc/bionic/libc_init_common.h @@ -28,16 +28,29 @@ #ifndef LIBC_INIT_COMMON_H #define LIBC_INIT_COMMON_H -#include +#include -typedef struct -{ - void (**preinit_array)(void); - void (**init_array)(void); - void (**fini_array)(void); +typedef struct { + void (**preinit_array)(void); + void (**init_array)(void); + void (**fini_array)(void); } structors_array_t; -extern void __libc_init_common(uintptr_t *elfdata); -extern void __libc_fini(void* finit_array); +__BEGIN_DECLS + +extern int main(int argc, char** argv, char** env); + +__noreturn void __libc_init(void* raw_args, + void (*onexit)(void), + int (*slingshot)(int, char**, char**), + structors_array_t const * const structors); +void __libc_fini(void* finit_array); + +__END_DECLS + +#if defined(__cplusplus) +struct KernelArgumentBlock; +void __libc_init_common(KernelArgumentBlock& args); +#endif #endif -- cgit v1.2.3