From owner-freebsd-hackers Tue Oct 17 12:07:46 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA03951 for hackers-outgoing; Tue, 17 Oct 1995 12:07:46 -0700 Received: from ibp.ibp.fr (ibp.ibp.fr [132.227.60.30]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA03944 for ; Tue, 17 Oct 1995 12:07:40 -0700 Received: from blaise.ibp.fr (blaise.ibp.fr [132.227.60.1]) by ibp.ibp.fr (8.6.12/jtpda-5.0) with ESMTP id UAA09393 for ; Tue, 17 Oct 1995 20:07:36 +0100 Received: from (uucp@localhost) by blaise.ibp.fr (8.6.12/jtpda-5.0) with UUCP id UAA02430 for freebsd-hackers@FreeBSD.ORG; Tue, 17 Oct 1995 20:07:36 +0100 Received: (from roberto@localhost) by keltia.freenix.fr (8.7.1/keltia-uucp-2.6) id UAA01970 for freebsd-hackers@FreeBSD.ORG; Tue, 17 Oct 1995 20:05:02 +0100 (MET) From: Ollivier Robert Message-Id: <199510171905.UAA01970@keltia.freenix.fr> Subject: crt0.c To: freebsd-hackers@FreeBSD.ORG (FreeBSD Hackers' list) Date: Tue, 17 Oct 1995 20:05:02 +0100 (MET) X-Operating-System: FreeBSD 2.2-CURRENT ctm#1215 X-Mailer: ELM [version 2.4 PL24 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG Precedence: bulk With all the talk about crt0.c, locale and friends, I just saw the following : crt0.c: if (getenv("ENABLE_STARTUP_LOCALE") != NULL) _startup_setlocale(LC_ALL, ""); asm ("__callmain:"); /* Defined for the benefit of debuggers */ exit(main(kfp->kargc, argv, environ)); } [...] static char * _getenv(name) register char *name; { extern char **environ; register int len; register char **P, *C; Why is it using "regular" getenv when it already has its own private one _getenv ? Note that changing getenv to _getenv does not really reduce binary size. I've tried to recompile crt0.c without any *STARTUP* variables defined to remove Andrey's "hack" and link "ls" static with it but "ls" doesn't change. -r-xr-xr-x 1 bin bin 167936 Oct 8 09:02 /bin/ls* -rwxr-xr-x 1 root wheel 167936 Oct 17 20:03 /usr/src/bin/ls/obj/ls* That's probably expected, maybe I did not follow the proper procedure. -- Ollivier ROBERT -=- The daemon is FREE! -=- roberto@keltia.frmug.fr.net FreeBSD keltia.freenix.fr 2.2-CURRENT #0: Sat Oct 14 19:05:10 MET 1995