[gccsdk] GCCSDK GCC 4 status update
John.Tytgat at aaug.net
Sat Jun 2 06:51:26 PDT 2007
In message <fa68a4ec4e.james at iyonix.jip22.freeuk.com>
gccsdk at jip22.freeuk.com wrote:
> So does this mean you can't in general use such objects in the module
> initialisation, finalisation, SWI handlers and so on as they won't be
That's true and should probably spelt out more clearly. Technically it
is not impossible to do the initialisation at module init time but there
is an additional twist that the SCL stubs for malloc()/free() & friends
are using RMA space for heap management when they are executed in SVC mode
(like at module init time) but application space when in USR mode (like at
module start time).
So doing the initialisation at module init time and if this would involve
allocating heap memory, you wouldn't be able to safely continue using
those objects at module start time.
Therefore I prefered to leave the initialisation of static objects happen
at start of main() like it already was.
John Tytgat, in his comfy chair at home BASS
John.Tytgat at aaug.net ARM powered, RISC OS driven
More information about the gcc