From owner-svn-src-all@FreeBSD.ORG Sat Dec 4 13:13:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB211065670; Sat, 4 Dec 2010 13:13:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 040028FC16; Sat, 4 Dec 2010 13:13:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:75bb:8efc:4511:c2ad] (unknown [IPv6:2001:7b8:3a7:0:75bb:8efc:4511:c2ad]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1B8D75C5A; Sat, 4 Dec 2010 14:13:47 +0100 (CET) Message-ID: <4CFA3E91.7090202@FreeBSD.org> Date: Sat, 04 Dec 2010 14:13:53 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20101201 Lanikai/3.1.8pre MIME-Version: 1.0 To: Kostik Belousov References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> <201012031817.23834.jkim@FreeBSD.org> <20101204103625.GA106@freebsd.org> <20101204105232.GI2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101204105232.GI2392@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Roman Divacky , Jung-uk Kim Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 13:13:49 -0000 On 2010-12-04 11:52, Kostik Belousov wrote: ... > I have no idea how and where your gcc is configured, in particular, I > find the non-documenting directive .zero somewhat puzzling. According to the gas sources (see contrib/binutils/gas/read.c, line 412), .zero is equivalent to .skip, which itself is equivalent to .space, except for HPPA targets. > Behaviour of clang looks like a plain bug, since initialized objects must > be put into the .data section, not into .bss. I think the only requirement is that the object is initialized at runtime with the value you specified at compile time. If you specify zero, it is simply an optimization to put it in BSS (which is really just an implementation detail). There is even a gcc flag to control this behaviour: -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. Clang also supports this flag, and its default setting is the same as gcc's.