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

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

[avr-gcc-list] internal error: out of range error (Dafni & Robert Berger


From: Dafni & Robert Berger
Subject: [avr-gcc-list] internal error: out of range error (Dafni & Robert Berger)
Date: Fri, 3 Sep 2004 08:57:36 +0300

>------------------------------

Date: Thu, 02 Sep 2004 13:34:56 -0600
From: "E. Weddington" <address@hidden>
To: Dafni & Robert Berger <address@hidden>
Cc: address@hidden
Subject: Re: [avr-gcc-list] internal error: out of range error
Message-ID: <address@hidden>
In-Reply-To: <NHBBKFJAALIKJPHAPKJNAEADCCAA.dafniz>
References: <NHBBKFJAALIKJPHAPKJNAEADCCAA.dafniz>
Content-Type: text/plain; charset=us-ascii; format=flowed
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Precedence: list
Message: 4

>Dafni & Robert Berger wrote:
>
>>Hi all,
>>
>>I am hitting the famous "out of range error", cause by an odd number of
data
>>bytes inserted in the .text section.
>>
>>This innocent line of code, which tries to put some version info into ROM
>>causes the error:
>>
>>const char      max7219_C_VER[] PROGMEM = "@(#) $Id: max7219.c,v 0.0
>>2004/01/25 18:58:09Dafni Exp $";
>>
>>
>>
>?
>AFAIK, an odd number of bytes inserted in the .text section, such as
>adding a PROGMEM string above, shouldn't cause that error.
>
>And, your line of code above looks good to me (assuming that the email
>client wrapped the line) and it builds fine for me on a mega128 with
>WinAVR 20040404.

I will try also with this version of WinAVR later. (I'll let you know)
Maybe the problem has also to do with the fact, that this line ends up in a
library,
which is linked together with other libraries at the end?

>
>>If I do the following:
>>
>>const char      max7219_C_VER[] __attribute__((__progmem__))
__attribute__
>>((__aligned__(2))) = "@(#) $Id: max7219.c,v 0.0 2004/01/25 18:58:09Dafni
Exp
>>$";
>>
>>I get the following in addition to the "out of range error":
>>
>>F:/projects/undercvs/bergomat/src/max7219/max7219.c:79: warning: alignment
>>of 'max7219_C_VER' is greater than maximum object file alignment.  Using 1
>>
>>
>>
>You shouldn't have to futz around with any alignment.
>
>>I'm compiling my file as follows:
>>
>>Compiling F:\projects\undercvs\bergomat\src\max7219/max7219.c
>>avr-gcc -c
>>F:/projects/undercvs/bergomat/src/max7219/max7219.c -DGCC_VER_GEQ_330=1 -g
dw
>>arf-2 -Wall -Wstrict-prototypes -Wa,-ahlms=F:\projects\undercvs\bergomat/l
st
>>/max7219.lst -mmcu=atmega128  -DGCC_VER_341 -D__AVR_GCC__  -g -O2  -DEXTME
M
>>-DSCH20030501 -DST_5510 -DARCHITECTURE_AVR128_UCOSII -D__DEBUG__    -IF:\p
ro
>>jects\undercvs\bergomat\src\max7219 -IF:/projects/undercvs/bergomat/includ
e
>>-IF:/projects/undercvs/bergomat/config/chip
>>-IF:/projects/undercvs/bergomat/config/board -IF:/projects/undercvs/bergom
at
>>/config/platform  -o max7219.elf
>>
>>This file will be a library:
>>
>>avr-ld -r -TF:/projects/undercvs/bergomat/config/atmega128_341.xr
>>max7219.elf  -o libmax7219.a
>>
>>The testcase, which causes the problem is built as follows:
>>
>>avr-gcc  -TF:/projects/undercvs/bergomat/config/atmega128_341.x  -Wl,-Map=
ma
>>x7219_test.elf.map,--cref -mmcu=atmega128 -o max7219_test.out
>>max7219_test.elf -LF:/projects/undercvs/bergomat/lib  -lboardinit -lcomm -
lu
>>cos_ii -lmax7219
>>
>>
>>
>I don't see anything obvious jumping out at me in the above.
>
>Could you post the actual compiler error? I assume that it refers to the
>line that you mentioned above.
>
>Eric

Well, that's intersting.
It does not.
Just by linking the library with the offending line, you get errors in other
files,
which, if you don't link this specific library are compiling and even
executing fine.

This is the real linker output, but dont be confused by the errors in
various files and even precompiled libraries.

---- link executable -----
avr-gcc  -TF:/projects/undercvs/bergomat/config/atmega128_341.x  -Wl,-Map=ma
x7219_test.elf.map,--cref -mmcu=atmega128 -o
 max7219_test.out
max7219_test.elf -LF:/projects/undercvs/bergomat/lib  -lboardinit -lcomm -lu
cos_ii -lmax7219
max7219_test.elf(.text+0xbc): In function `TestMAX7219Task':
F:/projects/undercvs/bergomat/src/max7219/hw_test1/max7219_test.c:119:
internal error: out of range error
F:/projects/undercvs/bergomat/lib\libboardinit.a(.text+0x394): In function
`BoardInitPhase2':
F:/projects/undercvs/bergomat/src/boardinit/boardinit.c:206: internal error:
out of range error
F:/projects/undercvs/bergomat/lib\libboardinit.a(.text+0x3a6):F:/projects/un
dercvs/bergomat/src/boardinit/boardinit.c:20
7: internal error: out of range error
F:/projects/undercvs/bergomat/lib\libboardinit.a(.text+0x3ae):F:/projects/un
dercvs/bergomat/src/boardinit/boardinit.c:20
8: internal error: out of range error
f:/avrgcc.341/bin/../lib/gcc/avr/3.4.1/../../../../avr/lib/avr5\libc.a(fdevo
pen.o)(.text+0x18): In function `fdevopen':
: internal error: out of range error
f:/avrgcc.341/bin/../lib/gcc/avr/3.4.1/../../../../avr/lib/avr5\libc.a(callo
c.o)(.text+0x18): In function `calloc':
: internal error: out of range error
f:/avrgcc.341/bin/../lib/gcc/avr/3.4.1/../../../../avr/lib/avr5\libc.a(callo
c.o)(.text+0x28): In function `calloc':
: internal error: out of range error
---- copying max7219_test.out max7219_test.elf -----
        1 file(s) copied.
---- max7219_test.out complete ----
gmake[1]: Leaving directory
`F:/projects/undercvs/bergomat/src/max7219/hw_test1/objs/AVR128_UCOSII'


If I just add, or remove a character of the string like:

const char      max7219_C_VER[]__attribute__((__progmem__, __aligned__(1)))=
"@(#) $Id: max7219.c,v 0.0 2004/01/25 18:58:09Dafni Exp $$";

Everything works fine:

---- link executable -----
avr-gcc  -TF:/projects/undercvs/bergomat/config/atmega128_341.x  -Wl,-Map=ma
x7219_test.elf.map,--cref -mmcu=atmega128 -o
 max7219_test.out
max7219_test.elf -LF:/projects/undercvs/bergomat/lib  -lboardinit -lcomm -lu
cos_ii -lmax7219
---- copying max7219_test.out max7219_test.elf -----
        1 file(s) copied.
---- max7219_test.out complete ----
gmake[1]: Leaving directory
`F:/projects/undercvs/bergomat/src/max7219/hw_test1/objs/AVR128_UCOSII'

Isn't this a very interesting error?

Regards,

Robert






reply via email to

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