Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Franck Bui-Huu <fbuihuu@gmail.com>
Cc: linux-arch@vger.kernel.org, macro@linux-mips.org,
	linux-mips@linux-mips.org
Subject: Re: [PATCH 1/2] Yet another __initxxx annotations: __initbss/__exitbss
Date: Sat, 1 Dec 2007 23:18:23 +0000	[thread overview]
Message-ID: <20071201231823.GB5411@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1196543586-6698-2-git-send-email-fbuihuu@gmail.com>

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:

  reply	other threads:[~2007-12-01 23:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-01 21:13 [RFC] Yet another __init annotation: __initbss Franck Bui-Huu
2007-12-01 21:13 ` [PATCH 1/2] Yet another __initxxx annotations: __initbss/__exitbss Franck Bui-Huu
2007-12-01 23:18   ` Russell King [this message]
2007-12-02 21:36     ` Franck Bui-Huu
2007-12-01 21:13 ` [PATCH 2/2] MIPS: vmlinux.lds.S: handle .{init,exit}.bss sections Franck Bui-Huu
2007-12-03 17:00   ` Luck, Tony
2007-12-03 17:00     ` Luck, Tony
2007-12-03 21:46     ` Franck Bui-Huu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071201231823.GB5411@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=fbuihuu@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox