[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] use of specifin RAM location

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] use of specifin RAM location
Date: Wed, 30 Nov 2005 16:34:01 +0100 (MET)

"Schwichtenberg, Knut" <address@hidden> wrote:

> 1. Stackpointer is set in main and therefore the changes in .init2
> are overwritten.  Is this a bug, a known bug or a feature?

A known bugfeature. ;-)

If you redefine __stack, this won't become a problem for you as both,
.init2 as well as main() use that symbol.

The second initialization in main() is obsolete now, and IIRC Björn
has plans to eventually remove it.

For that reason, better don't get used to -minit-stack, as that would
*only* patch the initialization in main().  If you want to relocate
the stack, modify __stack.

Beware, you need avr-libc 1.2.4 or above for this to work.  There's a
bug in the assembler which causes it to insert any known value for a
weak symbol immediately if the value of that symbol is already known
by the time of its use, so even though __stack is marked weak, the
assembler immediately replaced it by its numerical value inside crt*.o
(rather than deferring that decision to the linker).  We worked around
that bug by rearranging the assembly code in gcrt1.S so the value is
not yet known to the assembler by the time it assembles the .init2

> 2. -minit-stack=nnnn is not working see below

Because you're trying to pass that option to the linker (-Wl) rather
than the compiler.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]