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


Jamie Lokier wrote:
> 
> Artur Skawina wrote:
> > > A much more thorough approach, without the danger and still with
> > > sharing, is to have the linker optimise,  la -ffunction-sections
> > > -fdata-sections.  But extend the linker's gc-sections to do something
> > > like: put section .S in .init.S unless anybody from outside .init*
> > > references the section.
> >
> > void foo() __attribute__ ((section("init")) { bar("hello"); }
> > char *p;
> > void bar(char *s) {p=s;}
> 

I really don't see what we're fussed about.

If you do the above, you have written a bug and you get to enjoy a core
file.  There are plenty of ways of doing that!  You can create the same
bug with the _existing_ section control code.

There's nothing inherently bad about being to divert the section for
strings.  You just need to know what you're doing, no?


-- 
-akpm-

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