avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Re: snprintf bug ?


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] Re: snprintf bug ?
Date: Sat, 15 Oct 2005 07:39:13 +0200
User-agent: Mutt/1.4.2.1i

As Darcy Watkins wrote:

> I use a naked main function in a system because I have to use
> .init...  sections to set up an external SRAM interface and locate
> the stack somewhere else than at the top of internal SRAM.

Not needed.  Just set __stack appropriately (from the linker
command-line).  Even though currently the stack is initialized twice,
it ought to be initialized to the value __stack, only defaulting to
the top of RAM.

I believe you need the latest version (1.2.5) of avr-libc for it to
work, as it works around a bug in the assembler where .weak wasn't
honored properly, depending on the order of the assembly statements.
You can check the CVS log for gcrt1.S to see when I fixed that.

> ... will declaring main as "noreturn" suppress the automatic stack
> initialization at the top of internal SRAM?

No, AFAICT that needs a GCC change.  However, it should only be a
problem if you want to run main() recursively, and so far, I haven't
seen any use for this feature except of the IOCCC. ;-)

-- 
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]