linux-mips
[Top] [All Lists]

Re: [PATCH 1/2] Yet another __initxxx annotations: __initbss/__exitbss

To: Franck Bui-Huu <fbuihuu@gmail.com>
Subject: Re: [PATCH 1/2] Yet another __initxxx annotations: __initbss/__exitbss
From: Russell King <rmk@arm.linux.org.uk>
Date: Sat, 1 Dec 2007 23:18:23 +0000
Cc: linux-arch@vger.kernel.org, macro@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <1196543586-6698-2-git-send-email-fbuihuu@gmail.com>
Mail-followup-to: Franck Bui-Huu <fbuihuu@gmail.com>, linux-arch@vger.kernel.org, macro@linux-mips.org, linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1196543586-6698-1-git-send-email-fbuihuu@gmail.com> <1196543586-6698-2-git-send-email-fbuihuu@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Sat, Dec 01, 2007 at 10:13:05PM +0100, Franck Bui-Huu wrote:
> To select the BSS attribute for a peculiar section, the name of the
> section must start with 'bss.' pattern. This is at least how GCC
> 3.2/4.1.2 works and it's the reason why the 2 new sections haven't
> been called '.{init,exit}.bss'.
> 
> To mark a data part of one of these 2 sections, we use the 2 new
> annotations: __initbss/__exitbss.
> 
> All data marked as part of this section must not be initialized,
> of course.

Are you sure about this?  The gcc manual for 4.1.1 says:

     Use the `section' attribute with an _initialized_ definition of a
     _global_ variable, as shown in the example.  GCC issues a warning
     and otherwise ignores the `section' attribute in uninitialized
     variable declarations.

which has had that paragraph since at least 3.4.0.  Either the GCC
documentation is wrong or the compiler is misbehaving if what you say
works.  Either way, I'd be nervous about relying on this given that
GCC developers like to change the compiler behaviour.

Suggest getting the GCC developers nailed down to ensure we know what
the intended compiler behaviour is (and getting the docs to reflect that)
before relying on the existing behaviour.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

<Prev in Thread] Current Thread [Next in Thread>