[Top] [All Lists]

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

Subject: Re: [PATCH 1/2] Yet another __initxxx annotations: __initbss/__exitbss
From: Franck Bui-Huu <>
Date: Sun, 02 Dec 2007 22:36:55 +0100
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=UAZtJ3kEYqMZ+aXyXI1j+O2cHDEjVbOGZDCAPwqu7n0=; b=QorbrMCunR6s+Dt7kBm7+wX3O3HTWNHhM3sz6yHnayTCb8SqaPN9XmcxU3dACIDfeNtJppCCvCkKYqjMQ186N61RPY/IMB6OcOc9JEkx8YBwqyIfOOavTjYLaVQxf/4DM2zQFVOq5S40bdav7OcuaO0GSuHL7RC7Q0f+ARJ1t9s=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=vEi+tkwE2AbK8750dhpD8JOLotLYZp1tRI33SShQu6uLfbgrqGRJs/sXmjaWc7B//kFUaxQ3R3D/Q5nfyWdnFgck8qayxogOw49Be84MVnYh7Wu/wC9xUd6nU6nBOEysJgjWFzlGjyF5WEvqLGOsLBTXGNz+M8JbxT0ryq1R85c=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <>
User-agent: Thunderbird (X11/20070719)
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 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

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 ?


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