summaryrefslogtreecommitdiffstats
path: root/libc/arch-x86
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-07 19:48:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-02-07 19:48:17 +0000
commit2f41531ff9f48dbdaf2ba711e14c669031728e99 (patch)
treeae8b9be038220ed0d4cba96453560676d8bd4699 /libc/arch-x86
parentd4187efd7f9c30ffaff4738862e3d08be27a52e9 (diff)
parent42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6 (diff)
downloadbionic-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-xlibc/arch-x86/bionic/crtbegin.c29
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"