Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 1996 01:00:54 +0800
From:      Peter Wemm <peter@spinner.DIALix.COM>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: BLOAT in minimal programs 
Message-ID:  <199609261700.BAA03640@spinner.DIALix.COM>
In-Reply-To: Your message of "Thu, 26 Sep 1996 11:48:33 -0400." <9609261548.AA30202@halloran-eldar.lcs.mit.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote:
> <<On 26 Sep 1996 15:33:00 GMT, peter@spinner.DIALix.COM (Peter Wemm) said:
> 
> > 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609261700.BAA03640>