public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* initialize data not at file scope - WTF?
@ 2004-01-12 21:35 Ian Pilcher
  2004-01-12 21:54 ` Richard B. Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Pilcher @ 2004-01-12 21:35 UTC (permalink / raw)
  To: linux-kernel

In include/linux/init.h, it says:

   For initialized data:
   You should insert __initdata between the variable name and equal
   sign followed by value, e.g.:

   static int init_variable __initdata = 0;
   static char linux_logo[] __initdata = { 0x32, 0x36, ... };

   Don't forget to initialize data not at file scope, i.e. within a
   function, as gcc otherwise puts the data into the bss section and not
   into the init section.

Does this mean that __initdata can't be used for file scope variables,
that it can only be used for file scope variables, or something else?

Thanks!

-- 
========================================================================
Ian Pilcher                                        i.pilcher@comcast.net
========================================================================


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-01-12 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-12 21:35 initialize data not at file scope - WTF? Ian Pilcher
2004-01-12 21:54 ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox