other/10799: Constructors of static classes are not called

mhessel@xs4all.nl mhessel@xs4all.nl
Tue May 20 09:20:00 GMT 2003


Before function 'main' is call, all constructors of static classes should
be called.

Looking into the assembly of the generated code by the powerpc-eabi GCC
cross compiler version v2.x (see attachment 'Start powerpc-eabi-gcc
v2.x.gif'). Before calling 'main', function 'do_global_ctors' is called.
Function 'do_global_ctors' handles the initialisation of static classes.

Looking into the assembly of the generated code by the powerpc-eabi GCC
cross compiler version v3.x (see attachment 'Start powerpc-eabi-gcc
v3.x.gif'). Before calling 'main' a call is done to 'eabi.s' this function
does some house keeping but does not handle the initialisation of static
classes.

In my option when GCC is migrated to v3.x,
'gcc-2.x\gcc\config\rs6000\eabi-ctors.c' was removed. When adding
'eabi-ctors.c' to my project and calling 'do_global_ctors' before calling
'main' seems to solve the problem.

Cheers,
Marwijn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Start powerpc-eabi-gcc v2.x.gif
Type: image/gif
Size: 18118 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030520/5219aa72/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Start powerpc-eabi-gcc v3.x.gif
Type: image/gif
Size: 29619 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030520/5219aa72/attachment-0001.gif>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Version information powerpc-eabi-gcc v2.95.3.txt
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030520/5219aa72/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Version information powerpc-eabi-gcc v3.2.3.txt
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030520/5219aa72/attachment-0001.txt>


More information about the Gcc-bugs mailing list