other/10799: Constructors of static classes are not called

[email protected]
Newsgroups gmane.comp.gcc.bugs,gmane.comp.gcc.prs
Message-ID <[email protected]>
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
Start powerpc-eabi-gcc v2.x.gif (image/gif, 17.7 KB) - not displayed
Start powerpc-eabi-gcc v3.x.gif (image/gif, 28.9 KB) - not displayed
Version information powerpc-eabi-gcc v2.95.3.txt (text/plain, 58 B)
Using builtin specs.
gcc version 2.95.3 20010315 (release)
Version information powerpc-eabi-gcc v3.2.3.txt (text/plain, 414 B)
Reading specs from ./../lib/gcc-lib/powerpc-eabi/3.2.3/specs
Configured with: ../gcc-3.2.3/configure --target=powerpc-eabi --prefix=/Tools/H-i686-pc-cygwin --enable-languages=c,c++ --disable-shared --with-cpu=powerpc --with-gnu-as --with-gnu-ld --with-newlib --with-local-prefix=/Tools/H-i686-pc-cygwin/powerpc-eabi --with-headers=/Tools/H-i686-pc-cygwin/powerpc-eabi/include
Thread model: single
gcc version 3.2.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.