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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux