diff options
author | Elliott Hughes <enh@google.com> | 2013-02-07 19:48:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-02-07 19:48:17 +0000 |
commit | 2f41531ff9f48dbdaf2ba711e14c669031728e99 (patch) | |
tree | ae8b9be038220ed0d4cba96453560676d8bd4699 /libc/arch-x86 | |
parent | d4187efd7f9c30ffaff4738862e3d08be27a52e9 (diff) | |
parent | 42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6 (diff) | |
download | bionic-2f41531ff9f48dbdaf2ba711e14c669031728e99.zip bionic-2f41531ff9f48dbdaf2ba711e14c669031728e99.tar.gz bionic-2f41531ff9f48dbdaf2ba711e14c669031728e99.tar.bz2 |
Merge "Clean up the argc/argv/envp/auxv handling."
Diffstat (limited to 'libc/arch-x86')
-rwxr-xr-x | libc/arch-x86/bionic/crtbegin.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/libc/arch-x86/bionic/crtbegin.c b/libc/arch-x86/bionic/crtbegin.c index 5106d9e..63e58a6 100755 --- a/libc/arch-x86/bionic/crtbegin.c +++ b/libc/arch-x86/bionic/crtbegin.c @@ -26,21 +26,8 @@ * SUCH DAMAGE. */ -typedef struct -{ - void (**preinit_array)(void); - void (**init_array)(void); - void (**fini_array)(void); -} structors_array_t; - -extern int main(int argc, char **argv, char **env); - -extern void __libc_init( - unsigned int *elfdata, - void (*onexit)(void), - int (*slingshot)(int, char**, char**), - structors_array_t const * const structors -); +#include "../../bionic/libc_init_common.h" +#include <stddef.h> __attribute__ ((section (".preinit_array"))) void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1; @@ -51,18 +38,16 @@ void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1; __attribute__ ((section (".fini_array"))) void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1; -__attribute__((visibility("hidden"))) +__LIBC_HIDDEN__ __attribute__((force_align_arg_pointer)) void _start() { structors_array_t array; - void *elfdata; - array.preinit_array = &__PREINIT_ARRAY__; - array.init_array = &__INIT_ARRAY__; - array.fini_array = &__FINI_ARRAY__; + array.init_array = &__INIT_ARRAY__; + array.fini_array = &__FINI_ARRAY__; - elfdata = __builtin_frame_address(0) + sizeof(void *); - __libc_init(elfdata, (void *) 0, &main, &array); + void* raw_args = __builtin_frame_address(0) + sizeof(void*); + __libc_init(raw_args, NULL, &main, &array); } #include "__dso_handle.h" |