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:
> 
> 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;}


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