chiark / gitweb /
[PATCH] added klibc version 0.82 (cvs tree) to the udev tree.
[elogind.git] / klibc / klibc / arch / i386 / crt0.S
1 #
2 # arch/i386/crt0.S
3 #
4 # Does arch-specific initialization and invokes __libc_init
5 # with the appropriate arguments.
6 #
7 # See __static_init.c or __shared_init.c for the expected
8 # arguments.
9 #
10         
11         .text
12         .align 4
13         .type _start,@function
14         .globl _start
15 _start:
16         # Save the address of the ELF argument array
17         movl %esp,%eax          # Address of ELF arguments
18         # Set up a faux stack frame for the benefit of gdb
19         xorl %ebp,%ebp
20         push %ebp               # Keep gdb from getting confused
21         push %ebp               # Keep gdb from getting confused
22         # Push the arguments and called __libc_init()
23 #ifndef REGPARM
24         push %edx               # atexit() function
25         push %eax               # ELF array
26 #endif
27         call __libc_init
28         # If __libc_init returns, problem...    
29         ud2
30         hlt
31         
32         .size _start, .-_start
33