[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Advice on R_AVR_13_PCREL errors linkingforTiny85_and_
Re: [avr-gcc-list] Advice on R_AVR_13_PCREL errors linkingforTiny85_and_ Mega168?!
Sat, 31 Jan 2009 09:14:14 -0700
Hey, virtually a neighbor. You folks have had quite a winter up there
in the hills. Please keep sending the water ;)
And as for the fix: thank you and wow. The explanation matches
certain dark speculations I had while watching the linker complain.
Now I guess I'm off to figure out how to build binutils... will report
back on how it works out.
And Bitlash flashed its first LED on the Tiny85 as a result of that
pixie-dust link working. Now the work begins...
Cheers, and thanks,
Well I don't know whether to be more impresse
On Jan 30, 2009, at 6:01 PM, Weddington, Eric wrote:
org] On Behalf Of Bill Roy
Sent: Friday, January 30, 2009 5:37 PM
Subject: Re: [avr-gcc-list] Advice on R_AVR_13_PCREL errors
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.
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/
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
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
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.