[lkml]   [2000]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: how interesting are data->bss patches?
On Sun, 24 Sep 2000 08:31:12 -0500 (CDT), 
Jeff Garzik <> wrote:
>> On Sat, 23 Sep 2000 20:59:59 -0500 (CDT),
>> Peter Samuelson <> wrote:
>> >(A related question: __initdata *does* have to be initialized, right?)
>> If __initdata is not initialized then it ends up in the global .bss.
>> This would defeat the purpose of using __initdata.
>I am glad this was mentioned... It is a valid use of __initdata for
>static variables which you want to go away after boot. There might be
>some wasted space lurking here and there due to un-init'd __initdata

Another case to look at. I discovered that

char __initdata *cmd[] = {

Stores the 4 pointers of cmd in but the strings are down in
.rodata, i.e. they are not discarded after init. I got around it by

static __initdata char str_command1[] = "command1";
static __initdata char str_command2[] = "command2";
static __initdata char str_command3[] = "command3";
char __initdata *cmd[] = {

That put the strings in as well as the array. This simpler
version might work but I have not tried it.

char __initdata *cmd[] = {
__initdata "command1",
__initdata "command2",
__initdata "command3",

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:38    [W:0.028 / U:2.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site