summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/crt1.S
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-05-25 23:42:40 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-05-25 23:42:40 +0000
commitfe4154e930920d612cf6499f3f3fd419d6e0fe37 (patch)
tree860ff70fb5b2e2fd0f125eafa7443dda232e659d /libc/sysdeps/linux/i386/crt1.S
parentdf0e39281e8fc368208127c67f0fa2f0dcbcca20 (diff)
Adapt startup code in x86 and PPC to almost match glibc. _init vs. __libc_csu_init and
_fini vs. __libc_csu_fini remains to do.
Diffstat (limited to 'libc/sysdeps/linux/i386/crt1.S')
-rw-r--r--libc/sysdeps/linux/i386/crt1.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/libc/sysdeps/linux/i386/crt1.S b/libc/sysdeps/linux/i386/crt1.S
index 76e71be56..7eee8aea9 100644
--- a/libc/sysdeps/linux/i386/crt1.S
+++ b/libc/sysdeps/linux/i386/crt1.S
@@ -38,8 +38,9 @@ Cambridge, MA 02139, USA. */
.global _start
.type _start,%function
- .weak _init
- .weak _fini
+ .type _init,%function
+ .type _fini,%function
+ .type main,%function
.type __uClibc_start_main,%function
_start:
@@ -69,7 +70,6 @@ _start:
/* Push NULL to make sure stack ptr
is 16 byte aligned when calling __uClibc_start_main */
pushl %ebp
- pushl %ebp
/* Set up an invalid (NULL return address, NULL frame pointer)
callers stack frame so anybody unrolling the stack knows where
@@ -85,15 +85,14 @@ _start:
pop %edx
addl $_GLOBAL_OFFSET_TABLE_+[.-.L0],%edx
#endif
+ pushl %esp /* push stack ptr */
pushl %esi /* Push FINI pointer */
/* Push apps .init, .fini and main arguments to __uClibc_start_main() on the stack */
#ifdef L_Scrt1
- pushl main@GOT(%edx)
pushl _fini@GOT(%edx)
pushl _init@GOT(%edx)
#else
- pushl $main
pushl $_fini
pushl $_init
#endif
@@ -105,8 +104,10 @@ _start:
/* Ok, now run uClibc's main() -- shouldn't return */
#ifdef L_Scrt1
+ pushl main@GOT(%edx)
call *__uClibc_start_main@GOT(%edx)
#else
+ pushl $main
call __uClibc_start_main
#endif