Date: Wed, 9 Mar 2011 08:23:41 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Roman Divacky <rdivacky@freebsd.org>, current@freebsd.org Subject: Re: [TESTING]: one more boot2 shrinking patch Message-ID: <201103090823.41757.jhb@freebsd.org> In-Reply-To: <20110308205212.GA96321@freebsd.org> References: <20110308173909.GA71091@freebsd.org> <20110308211931.1c5deb8b@r500.local> <20110308205212.GA96321@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, March 08, 2011 3:52:12 pm Roman Divacky wrote: > On Tue, Mar 08, 2011 at 09:19:31PM +0100, Fabian Keil wrote: > > Roman Divacky <rdivacky@freebsd.org> wrote: > > > > > this diet patch > > > > > > http://lev.vlakno.cz/~rdivacky/boot2-final-diet.patch > > > > > > includes these changes: > > > > > > o bunch of variables are turned into uint8_t > > > > > > o initial setting of namep[] in lookup() is removed > > > as it's only overwritten a few lines down > > > > > > o kname is explicitly initialized in main() as BSS > > > in boot2 is not zeroed > > > > Are you saying the previous: > > > > static const char *kname = NULL; > > > > didn't work, or is this the explanation why the > > initialization hasn't simply been removed? > > gcc nor clang emits any code to initialize static type foo = 0; > because it's expected that BSS is zeroed, which is not the case > in boot2 so we have to initialize that explicitly It used to be that if you explicitly initialized a variable to 0, it was initialized to 0 in .data, but now gcc and clang recognize it is set to 0 and move it to .bss. There appears to be no way to turn this feature off, and while it is useful for most programs, it is not useful for boot code such as this. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103090823.41757.jhb>