From fe4154e930920d612cf6499f3f3fd419d6e0fe37 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 25 May 2005 23:42:40 +0000 Subject: 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. --- libc/sysdeps/linux/i386/crt1.S | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libc/sysdeps/linux/i386') 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 -- cgit v1.2.3