lkml.org 
[lkml]   [2005]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Questions on __initdata
Date
On Sun, 4 Dec 2005 15:15:33 +0100, 
Jean Delvare <khali@linux-fr.org> wrote:
>Hi all,
>
>I've been reading the heading comment of include/linux/init.h to learn
>when and how __initdata can be used. Some of the help text doesn't seem
>to match my observations, and some of it confused me and could probably
>be made clearer. However, I don't feel completely comfortable with this
>topic yet and would welcome comments.
>
>First, the comment goes:
>
>> /* These macros are used to mark some functions or
>> * initialized data (doesn't apply to uninitialized data)
>> * as `initialization' functions. The kernel can take this
>> * as hint that the function is used only during the initialization
>> * phase and free up used memory resources after
>
>My tests (on i386) seem to suggest that "doesn't apply to uninitialized
>data" only holds for non-global variables. Tagging uninitialized global
>variables __initdata works, and moves the variables from .bss to .data.
>Is it correct? Does it work on all archs? If so, the comment above
>needs to be fixed.

gcc version dependent. Older versions of gcc put all uninitialized
global variables into .bss, even if there was an attribute like
__initdata that tried to use a different section. So we got into the
habit of '__initdata variables must be explicitly initialized'. Some
platforms are using old versions of gcc where that restriction may
still apply.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-06 05:45    [W:0.356 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site