[Top][All Lists]

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

[avr-gcc-list] RE: internal error: out of range error (Erik Christiansen

From: Dafni & Robert Berger
Subject: [avr-gcc-list] RE: internal error: out of range error (Erik Christiansen)
Date: Thu, 9 Sep 2004 21:08:37 +0300

-----Original Message-----
From: Erik Christiansen [mailto:address@hidden
Sent: Thursday, September 09, 2004 10:54 AM
To: Dafni & Robert Berger
Cc: address@hidden
Subject: Re: internal error: out of range error (Erik Christiansen)

Erik wrote:
>There's a clue here. If it's "Using 1" as claimed, then we should have
>even byte alignment. Does objdump -D show odd alignment, confirming that
>the error message has the cause we expect?
>Alternatively, have you had a chance to try in-lining an asm ".align 1" ?
>Just by clearing the error message, it would also confirm the cause.
>(This might still be the easiest fix.)

I don't know exactly what's the syntax to inline an assembly directive from
__asm__ __volatile__ (".align 1");
gives a compiler error:
F:/projects/undercvs/bergomat/src/max7219/max7219.c:79: error: parse error
before "volatile"

>OR, since .rel.rodata is not a convenient section, we could roll our
>own, and place it _after_ all other .text in the flash image, so that
>The whole problem goes away. In the linker script, after:


This also didn't work, but both hints inspired me to the following:

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 :
    . = ALIGN(2);
    *(.init0)  /* Start here after reset.  */


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.

    . = ALIGN(2);
    . = ALIGN(2);

So the solution is so simple.

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

Thanks for your help and inspiration.



reply via email to

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