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: section placement q


Artur Skawina wrote:
> 
> ...
> > 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".
> 
> But would this really solve the problem? Yes, it could reduce the
> ugliness a bit, but is potentialy dangerous. As you still have to
> make sure no "local" strings are used later, i'm not convinced this
> is actually an improvement over the conservative approach.

I agree that it's a bit dangerous to use on a function, but in practise,
this 'default string diversion' would mainly be used within
initialisers, where accidents are less likely to occur.  Caveat emptor.

> ...
> I've put up the patch vs 2.3.40pre1 at
>  http://www.geocities.com/SiliconValley/Heights/6494/sw/patch-initstr.gz
> ...

Wow.  Did that save ~30k?  It only touches a fraction of the files which
it _could_ be used on.

-- 
-akpm-

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