From dfe2d42547de8197f850f3ff0dfdc3caa4682518 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Mon, 19 Feb 2001 00:24:52 +0000 Subject: Create __uClibc_main to handle what can be done in C instead of each arch's respective crt0.S. crt0.S should now only be responsible for setting things up to call __uClibc_main(argc, argv, envp), which will do any other necessary setup (setting global __environ, stdio init, etc), call main, and exit. This should ease both maintainance and porting. --- libc/sysdeps/linux/i386/crt0.S | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/i386/crt0.S b/libc/sysdeps/linux/i386/crt0.S index a87287bc3..79e0a6748 100644 --- a/libc/sysdeps/linux/i386/crt0.S +++ b/libc/sysdeps/linux/i386/crt0.S @@ -30,11 +30,7 @@ Cambridge, MA 02139, USA. */ NULL */ -.global __environ .global _start -.global exit -.global main -.global _start_exit .text _start: @@ -73,30 +69,5 @@ _start: sub %ebx,%ebx int $0x80 - /* set up __environ */ - movl 8(%esp),%eax - movl %eax,__environ - - /* Ok, now run main() */ - call main - pushl %eax - call exit - - /* Just in case _exit fails... We use int $0x80 for __exit(). */ - popl %ebx - .align 4,0x90 -_start_exit: - movl $1,%eax - int $0x80 - jmp _start_exit - .align 4,0x90 -_void_void_null_func: - ret - -.data -__environ: - .long 0 -.weak environ -.align 4 -environ = __environ - + /* Ok, now run uClibc's main() -- shouldn't return */ + call __uClibc_main -- cgit v1.2.3