avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] Re: internal error: out of range error


From: Erik Christiansen
Subject: [avr-gcc-list] Re: internal error: out of range error
Date: Fri, 10 Sep 2004 12:44:57 +1000
User-agent: Mutt/1.5.6+20040722i

On Thu, Sep 09, 2004 at 09:08:37PM +0300, Dafni & Robert Berger wrote:
> 
> I went back to my initial suspicious line of code:
> 
> const char      max7219_C_VER[] PROGMEM = "@(#) $Id: max7219.c,v 0.0
> 2004/01/25 18:58:09Dafni Exp $";
> 
> In the linker script for the library *.xr I added the . = ALIGN(2); and
> that's it.
> 
>   /* Internal text space or external memory */
>   .text :
>   {
>     *(.vectors)
>     *(.progmem.gcc*)
>     *(.progmem*)
>     . = ALIGN(2);
>     *(.init0)  /* Start here after reset.  */
>     *(.init1)
> 
>   ...
>   }
> 
> 
> It does not seem to be necessary to add it to .text and .text.* as well,
> since all the other stuff is
> obviously generated properly.
> 
>     *(.text)
>     . = ALIGN(2);
>     *(.text.*)
>     . = ALIGN(2);
> 
> So the solution is so simple.

Yes, if the linker script lacks alignment restoration after .progmem,
then the original problem is now clear.

> BTW the standard linker scripts, which come with winavr should be corrected
> as well IMHO.

There are enough to choose from. :-)
I've noted at the top of the one I'm using:

/* Based on avr-gcc's default linker script, for normal executables */

and it already has realignment after .progmem*.

> Thanks for your help and inspiration.
> 

No worries. (I'm considering moving from 100% assembler to some C, so it
was interesting to see if there is anything scary in using custom linker
scripts with avr-gcc.)

Erik


reply via email to

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