Re: [PATCH 00/34] __initdata cleanup

Heiko Carstens
2007-02-09T17:01:25Z

On Fri, Feb 09, 2007 at 05:11:32PM +0200, Alon Bar-Lev wrote:
>
> Follow-up Russell King comment at http://lkml.org/lkml/2007/1/22/267
>
> All __initdata variables should be initialized so they won't end up
> in BSS.
>
> There is no dependency between patches or even hunks.
>
> Some architecture patches are untested, this is documented as "UNTESTED"
>
> Against 2.6.20-rc6-mm3.

To quote parts of that:

Anyway, here's what the GCC manual has to say about use of
__attribute__((section)) on variables:

`section ("SECTION-NAME")'
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.

You may only use the `section' attribute with a fully initialized
global definition because of the way linkers work. The linker
requires each object be defined once, with the exception that
uninitialized variables tentatively go in the `common' (or `bss')
section and can be multiply "defined". You can force a variable
to be initialized with the `-fno-common' flag or the `nocommon'
attribute.

And the top-level Makefile has:

CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common

Note the -fno-common.

And indeed all the __initdata annotated local and global variables on
s390 are in the init.data section. So I'm wondering what this patch
series is about. Or I must have missed something.