This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: section placement q
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;}
Ew. Is there anything short of global data flow/type analysis that can
at least warn about this sort of thing?
-- Jamie