From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: rmk@arm.linux.org.uk
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: Sun, 02 Dec 2007 22:36:55 +0100 [thread overview]
Message-ID: <47532577.804@gmail.com> (raw)
In-Reply-To: <20071201231823.GB5411@flint.arm.linux.org.uk>
Russell King wrote:
> 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.
>
Thanks for pointing this out.
We already have (incorrectly) uninitialized data which are part of the
init.data section and the section attribute isn't ignored at all, at
least on x86 and mips. On ARM, you could take a look at where
'command_line' array, declared in in arch/arm/kernel/setup.c, is
placed.
So, it seems that we already rely on 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.
>
Yes I agree. Do you have someone in mind to suggest or should I ask to
the GCC mailing list ?
Franck
next prev parent reply other threads:[~2007-12-02 21:37 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
2007-12-02 21:36 ` Franck Bui-Huu [this message]
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=47532577.804@gmail.com \
--to=vagabon.xyz@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@linux-mips.org \
--cc=rmk@arm.linux.org.uk \
/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