> -----Original Message-----
> From: 
> avr-gcc-list-bounces+eweddington=cso.atmel....@nongnu.org 
> [mailto:avr-gcc-list-bounces+eweddington=cso.atmel....@nongnu.
> org] On Behalf Of Bill Roy
> Sent: Friday, January 30, 2009 5:37 PM
> To: avr-gcc-list@nongnu.org
> Subject: Re: [avr-gcc-list] Advice on R_AVR_13_PCREL errors 
> linkingforTiny85_and_ Mega168?!
> 
> Hi, Eric:
> 
> Thanks for your kind followup.  Here's the state of play as the sun  
> sets in Denver.

Hey, I'm west of the Springs up at 8500 feet in the mountains. ;-) Used to live 
in the mountains west of Denver.
 
> Still puzzled here. 
<snip> 
> firmware bill$ make clean hex
> rm -f main.hex main.lst main.obj main.cof main.list main.map  
> main.eep.hex main.elf *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/ 
> usbdrv.s *.lst
> avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - 
> mmcu=attiny85 

Ok, stop right there.

It just so happens that a work colleague of mine ran into the very same issue 
with R_AVR_13_PCREL and the tiny85. I was finally able to track it down.

Unfortunately it looks like a bona fide bug in binutils. I have a patch, that 
so far seems to fix the problem. I just submitted the patch upstream.

Basically, the problem stems from the fact that the linker allows all devices 
in only the avr2 and avr4 architectures to wrap around the offsets. Devices in 
the avr25 architecture should be allowed to do that too (as avr25 is the same 
as avr2, plus 2 extra instructions), but for some reason it looks like the 
avr25 was forgotten when it comes to this reloc. It just so happens that the 
ATtiny85 belongs to the avr25 architecture. My work colleague mentions that he 
doesn't have this problem when he uses an ATmega8 (with the same amount of code 
space). And that is because the ATmega8 belongs to the avr4 architecture.

I see you're using a Mac. The patch for binutils is attached. Feedback on how 
it works for you would be appreciated. This fix will be in the next WinAVR 
release.

Eric Weddington


begin 666 41-binutils-2.19-avr25-wraparound-reloc.patch
M+2TM(&)F9"]E;&8S,BUA=G(N8RYO;&0),C P.2TP,2TS," Q-#HT,3HT,2XP
M,3(X,S,T,# @+3 W,# **RLK(&)F9"]E;&8S,BUA=G(N8PDR,# Y+3 Q+3,P
M(#$T.C0S.C$Y+C<R,38T,S<P," M,#<P, I 0" M.#4T+#$P("LX-30L,3$@
M0$ @879R7V9I;F%L7VQI;FM?<F5L;V-A=&4...@*')E;&]C7VAO=W1O7W1Y< H@
M"7L*(" @(" @(" @(" O*B!296QA=&EV92!D:7-T86YC92!I<R!T;V\@;&%R
M9V4N(" J+PH@"BT)(" O*B!!;'=A>7,@87!P;'d...@5u)!4$%23U5.1"!F;W(@
M879R,B!A;f...@879r-"X@("HO"BL)(" O*B!!;'=A>7,@87!P;'d...@5u)!4$%2
M3U5.1"!F;W(@879R,b...@879r,C4L(&%N9"!A=G(T+B @*B\*( D@('-W:71C
M:" H8F9D7V=E=%]M86-H("AI;G!U=%]B9F0I*0H@"2 @("!["B )(" @(&-A
M<v...@8f9d7vua8va?879r,CH**PD@(" @8V%S92!B9F1?;6%C:%]A=G(R-3H*
K( D@(" @8V%S92!B9F1?;6%C:%]A=G(t...@h@"2 @(" @(&)R96%K.PH@"@``
`
end


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to