http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61079
Bug ID: 61079 Summary: #pragma fini doesn't apply without definition Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org Host: *-*-solaris2.* Target: *-*-solaris2.* Build: *-*-solaris2.* Consider the following testcase: $ cat dtor-pragma-decl.c #pragma fini(dtor) void dtor (void); $ gcc -S dtor-pragma-decl.c $ cat dtor-pragma-decl.s .file "dtor-pragma-decl.c" .ident "GCC: (GNU) 4.9.0" $ cc -S dtor-pragma-decl.c $ cat dtor-pragma-decl.s [...] .file "dtor-pragma-decl.c" .section .fini,"ax" call dtor nop I.e. Studio cc calls dtor from a .fini section, while gcc ignores the pragma. I'm seeing the same behavior with __attribute__((destructor)), which newer versions of Studio cc understand. At least for the pragma case, which gcc implements for Studio compatiblity, this seems wrong. Rainer