[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] minit-stack
From: |
Ruud Vlaming |
Subject: |
[avr-gcc-list] minit-stack |
Date: |
Wed, 22 Oct 2008 10:39:32 +0200 |
User-agent: |
KMail/1.9.1 |
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] minit-stack,
Ruud Vlaming <=