C++ problems with sh4

Alexandra Kossovsky sasha at oktet.ru
Mon Nov 5 10:23:35 UTC 2001


Hi!

I have gensh4 bsp, and I need C++ to work.
It worked perfectly with ss-20010816

Now, in ss-20011017 (or ss-20011025) it does not work.
The problem is with global constructors -- they are not called.

gcc does not define __USE_INIT_FINI__ for sh4.
In 'gcc-2.95.3/gcc/config/sh/elf.h' there is:
---------
/* Arrange to call __main, rather than using crtbegin.o and crtend.o
   and relying on .init and .fini being executed at appropriate times.  */
---------

In ss-20010816 gcc calls '__do_global_ctors' on the begining of 'main()', 
and all is OK. In ss-20011025 where are no 'main()'.

What can I do? 
Should I patch gcc to do all this things through init & fini ?
Or something else?

Regards,
	Alexandra.
-- 

Alexandra Kossovsky
OKTET Ltd.
1 Ulianovskaya st., Petergof, St.Petersburg, 198904 Russia
Phones: +7(812)428-43-84(work) +7(812)184-52-58(home) +7(812)956-42-86(mobile)
e-mail: sasha at oktet.ru (or sasha at gate.ort.spb.ru)




More information about the users mailing list