From owner-freebsd-current Thu Sep 26 10:01:14 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA05272 for current-outgoing; Thu, 26 Sep 1996 10:01:14 -0700 (PDT) Received: from spinner.DIALix.COM (root@spinner.DIALix.COM [192.203.228.67]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA05222 for ; Thu, 26 Sep 1996 10:01:08 -0700 (PDT) Received: from spinner.DIALix.COM (peter@localhost.DIALix.oz.au [127.0.0.1]) by spinner.DIALix.COM (8.7.6/8.7.3) with ESMTP id BAA03640; Fri, 27 Sep 1996 01:00:54 +0800 (WST) Message-Id: <199609261700.BAA03640@spinner.DIALix.COM> X-Mailer: exmh version 1.6.7 5/3/96 To: Garrett Wollman cc: freebsd-current@freebsd.org Subject: Re: BLOAT in minimal programs In-reply-to: Your message of "Thu, 26 Sep 1996 11:48:33 -0400." <9609261548.AA30202@halloran-eldar.lcs.mit.edu> Date: Fri, 27 Sep 1996 01:00:54 +0800 From: Peter Wemm Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Garrett Wollman wrote: > < > > Yes, we do have a special version of crt0.o, it's /usr/lib/scrt.o and gcc > > correctly links with it: > > > /usr/lib/libgcc.a(__main.o) needed due to ___main > > We really should fix our crt0 and libc to do things right and not need > __main or the functions it calls. > > -GAWollman Well, having crt0.c calling __do_global_ctors before main() and having exit.c in libc calling __do_global_dtors() seems a bit gcc-centric to me, but I guess there's not a lot of alternative if we want to keep the -static overheads minimal. Sigh, and the ELF file format solves it so nicely (or any other file formt with multiple arbitary sections) by contatenating a call lists and crt0.o's task simply becomes "call .init" and for exit(), it's "call .fini" (or is that __init and __fini? I never can remember). All the work is done once-off at link time and there's only any constructor/destructor glue *IF* there are any C++ object's present somewhere. It simply is left out otherwise. It's not quite like linker sets, the result is an executable chunk of code. Cheers, -Peter