This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Target-specific pragmas


On Tue, 26 Jun 2001, Joern Rennecke wrote:

> > ISTR that something like this would be useful for the Linux kernel, so
> > that strings in data used only at bootup can be freed, the same way the
> > arrays containing pointers to them, and initialization functions, are
> > freed.
> 
> Hmm, why not making them arrays of char then?

Because defining a separate array out of line for every such string
constant is very cumbersome and messy compared to having a strings_section
attribute that could go in the kernel's __initdata macro definition.

(For anyone implementing something like this: the semantics of section
attributes for strings would include: strings remain readonly independent
of section; strings within the same section may be merged but those in
different sections may not.  If strings get merged with const-qualified
compound literals, those would count as strings in the default section.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]