summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-02-19 00:24:52 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-02-19 00:24:52 +0000
commitdfe2d42547de8197f850f3ff0dfdc3caa4682518 (patch)
tree0b2969dbdd6c65f1fb5832e25d28bffa9570084a /libc/sysdeps/linux/i386
parent438aac726283dfffa6a5cf84b4acf6df0250af94 (diff)
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.
Diffstat (limited to 'libc/sysdeps/linux/i386')
-rw-r--r--libc/sysdeps/linux/i386/crt0.S33
1 files changed, 2 insertions, 31 deletions
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