[gccsdk] GCCSDK GCC 4 status update

John Tytgat John.Tytgat at aaug.net
Sat Jun 2 04:48:39 PDT 2007

In message <88ef9aec4e.james at iyonix.jip22.freeuk.com>
          gccsdk at jip22.freeuk.com wrote:

> I may be way off the mark here as I've not used C++ much on RISC OS,
> but how does (non-trivial) static initialisation of namespace scope
> variables interact with module initialisation and entering the module?
> IIRC. for a given execution unit, it must only happen *before*
> any functions in that execution unit are entered. This leaves scope
> for allocations at initialisation time (presumably using the RMA) and
> when running a module application, presumably using the heap in
> application space. [I'm not sure about this point].
> I could see this getting quite hairy with say a statically initialised 
> std::vector, which is then resized by the running application, or
> destructors of statically allocated objects are called and application 
> exit or module finalisation.

Such static initialisation code gets run via __gccmain uses __CTOR_LIST__
array to call all the initialisation routines.  __gccmain is one of the
first calls in any gcc compiled main() routine.  So that meams those
are run in the module start code (and not module init) routine.  BTW, that
was one of the things I had to fix to get C++ module support working in
3.4.5, see <URL:http://www.riscos.info/websvn/listing.php?repname=gccsdk&path=%2Ftrunk%2Fgcc%2F&rev=1746&sc=1>.

John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven

More information about the gcc mailing list