On gcc 4.2.3 it was possible to use something like

  -minit-stack="xOS+xOSstackShift"

as compiler option. where xOS is an array or structure, and xOSstackShift a
constant number to be defined by 

    asm(".set xOSstackShift, "  DefToString(OSstackInit) " \n\t ");

This way it is possible to let the stack start at the top of an array
to be defined by &xOS.StackOS[OSstackInit].

Anyway, in gcc 4.3.2 it seems no longer be possible to use
that compiler option. (I get an compiler error, although the documentation
of 4.3.2 still says it is allowed to use that option) The preferred 
way seems to be using the __stack symbol, something like this:

-Wl,--defsym=__stack=xOS+xOSstackShift

However, that trick does not longer functions. I can set 
   -Wl,--defsym=__stack=xOS
but the addition is not longer permitted.

A workaround could be to define (in the code) something like 
(untested)

  const uint16_t __stack =  &xOS.StackOS[OSstackInit];

but that costs bytes in the data space, not to mention that
it also requires copy code to copy flash into ram (i usually
don't have "data" bytes). Thus seems like a waste.

Is there some other way to solve this, or make the trick of 
minit-stack work in the new setting?

Ruud


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to