This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

other/10799: Constructors of static classes are not called


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

Attachment: Start powerpc-eabi-gcc v2.x.gif
Description: GIF image

Attachment: Start powerpc-eabi-gcc v3.x.gif
Description: GIF image

Attachment: Version information powerpc-eabi-gcc v2.95.3.txt
Description: Text document

Attachment: Version information powerpc-eabi-gcc v3.2.3.txt
Description: Text document


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