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
This commit is contained in:
Elliott Hughes
2013-02-07 10:14:39 -08:00
parent d32fdbaf03
commit 42b2c6a5ee
16 changed files with 383 additions and 417 deletions

View File

@@ -28,16 +28,29 @@
#ifndef LIBC_INIT_COMMON_H
#define LIBC_INIT_COMMON_H
#include <stdint.h>
#include <sys/cdefs.h>
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