From owner-freebsd-current@FreeBSD.ORG Thu Mar 10 15:23:16 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA53D106566C; Thu, 10 Mar 2011 15:23:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AD7628FC14; Thu, 10 Mar 2011 15:23:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4E57E46B49; Thu, 10 Mar 2011 10:23:16 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D9A888A01B; Thu, 10 Mar 2011 10:23:15 -0500 (EST) From: John Baldwin To: Dimitry Andric Date: Thu, 10 Mar 2011 09:20:58 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <20110308173909.GA71091@freebsd.org> <201103090823.41757.jhb@freebsd.org> <4D780C34.4010509@FreeBSD.org> In-Reply-To: <4D780C34.4010509@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103100920.58279.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 10 Mar 2011 10:23:16 -0500 (EST) Cc: Roman Divacky , freebsd-current@freebsd.org Subject: Re: [TESTING]: one more boot2 shrinking patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2011 15:23:16 -0000 On Wednesday, March 09, 2011 6:24:36 pm Dimitry Andric wrote: > On 2011-03-09 14:23, John Baldwin wrote: > >> 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, > > Yes, there is; both gcc and clang have this option to turn it off: > > -fno-zero-initialized-in-bss > If the target supports a BSS section, GCC by default puts variables > that are initialized to zero into BSS. This can save space in the > resulting code. > > This option turns off this behavior because some programs > explicitly rely on variables going to the data section. E.g., so > that the resulting executable can find the beginning of that > section and/or make assumptions based on that. > > The default is -fzero-initialized-in-bss. Hah, that is better then. Thanks! I should have searched about this more myself. :( Roman, can you try reverting the kname changes and adding this to CFLAGS instead for both compilers? -- John Baldwin