This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: section placement q
Artur Skawina wrote:
>
> Andrew Morton wrote:
> >
> > void __attribute__ ((__section__ (".some_section"))) foo(void)
> > {
> > bar("hello, world\n");
> > }
> >
> > The string goes into .rodata. We'd like it in <where?>
>
> i don't know where you'd like to have it, but it _must_ default to
> .rodata (for obvious reasons -- the pointer might stick around)
Sure, the default shouldn't be altered.
What would be ideal is the ability to alter the default for a particular
scope:
void __attribute__ ( (__section__ (".some_section")),
(__strings__(".some_string_section")))
foo(void)
{
bar("hello");
}
So during the scope of the __strings__ attribute, the old (".rodata")
section identifier is stacked and replaced with ".some_string_section".
Guess I should shut up and look at the source :)
> ...
> Saved a few dozen kb, but was
> ugly enough that i decided it wasn't worth maintaining.
mm.. A "few dozen kb" is fairly attractive, actually.
--
-akpm-