From ae35d725cf586347b2adb1a6fe4216e70fce16cf Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 27 Nov 2002 23:34:07 +0000 Subject: Make support for global constructors and global destructors be configurable, so people who do not need or want ctor/dtor support can disable it and make their binaries a little bit smaller. -Erik --- libc/sysdeps/linux/i386/crt0.S | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libc/sysdeps/linux/i386') diff --git a/libc/sysdeps/linux/i386/crt0.S b/libc/sysdeps/linux/i386/crt0.S index 97f1fde63..be66b9a2d 100644 --- a/libc/sysdeps/linux/i386/crt0.S +++ b/libc/sysdeps/linux/i386/crt0.S @@ -61,6 +61,7 @@ _start: pushl %ebp /* callers %ebp (frame pointer) */ movl %esp,%ebp /* mark callers stack frame as invalid */ +#ifdef __UCLIBC_CTOR_DTOR__ /* Push .init and .fini arguments to __uClibc_start_main() on the stack */ pushl $_fini pushl $_init @@ -72,6 +73,14 @@ _start: /* Ok, now run uClibc's main() -- shouldn't return */ call __uClibc_start_main +#else + /* Push envp, argc, and argc arguments to __uClibc_start_main() on the stack */ + pushl %eax /* Environment pointer */ + pushl %ebx /* Argument pointer */ + pushl %ecx /* And the argument count */ + + call __uClibc_main +#endif /* Crash if somehow `exit' returns anyways. */ hlt -- cgit v1.2.3