[uClibc-cvs] uClibc/libc/sysdeps/linux/i386 crt0.S,1.13,1.14

Erik Andersen andersen at codepoet.org
Wed Nov 27 23:34:30 UTC 2002


Update of /var/cvs/uClibc/libc/sysdeps/linux/i386
In directory winder:/tmp/cvs-serv365/libc/sysdeps/linux/i386

Modified Files:
	crt0.S 
Log Message:
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


Index: crt0.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/i386/crt0.S,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- crt0.S	1 Oct 2002 05:30:12 -0000	1.13
+++ crt0.S	27 Nov 2002 23:33:56 -0000	1.14
@@ -61,6 +61,7 @@
 	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 @@
 
 	/* 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




More information about the uClibc-cvs mailing list