Normally the following code produces a new section with type SHT_INIT_ARRAY and the function foo will be executed before the main routine starts. This is what i got unter Linux-Systems. But under SPARC Systems the new section entry is of type SHT_PROGBITS and won't execute before the main-routine.
static void foo() { ; }; void (*const init_array []) (void) __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) = { &foo }; int main() {printf("main"); return 0;} -- Summary: Attribute with section (".init_array") does't work under SPARC Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pastoor dot external at onespin-solutions dot com GCC build triplet: SPARC GCC host triplet: SPARC GCC target triplet: SPARC http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28715