Hello and good day:

Seeking advice on R_AVR_13_PCREL errors at link time.

I'm porting Bitlash to the Tiny85 for an avrusb + EasyLogger application. More on Bitlash at: http://bitlash.net

I believe the code is slimmed down enough to fit, but now the link fails with multiple R_AVR_13_PCREL errors. Here is an example:

bill$ make hex
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - funsigned-char -funsigned-bitfields -ffunction-sections -mcall- prologues -fdata-sections -mshort-calls -mno-tablejump -fno-delete- null-pointer-checks -mmcu=atmega168 -c eeprom.c -o eeprom.o avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - funsigned-char -funsigned-bitfields -ffunction-sections -mcall- prologues -fdata-sections -mshort-calls -mno-tablejump -fno-delete- null-pointer-checks -mmcu=atmega168 -c bitlash.c -o bitlash.o avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - funsigned-char -funsigned-bitfields -ffunction-sections -mcall- prologues -fdata-sections -mshort-calls -mno-tablejump -fno-delete- null-pointer-checks -mmcu=atmega168 -c main.c -o main.o avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - funsigned-char -funsigned-bitfields -ffunction-sections -mcall- prologues -fdata-sections -mshort-calls -mno-tablejump -fno-delete- null-pointer-checks -mmcu=atmega168 -c usbdrv/usbdrv.c -o usbdrv/ usbdrv.o avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - funsigned-char -funsigned-bitfields -ffunction-sections -mcall- prologues -fdata-sections -mshort-calls -mno-tablejump -fno-delete- null-pointer-checks -mmcu=atmega168 -c usbdrv/usbdrvasm.S -o usbdrv/ usbdrvasm.o avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 - funsigned-char -funsigned-bitfields -ffunction-sections -mcall- prologues -fdata-sections -mshort-calls -mno-tablejump -fno-delete- null-pointer-checks -mmcu=atmega168 -Wl,-Map=main.map,--cref -Wl,-- relax -Wl,--gc-sections -o main.elf usbdrv/usbdrv.o -lc usbdrv/ usbdrvasm.o main.o bitlash.o eeprom.o
bitlash.o: In function `doCommand':
bitlash.c:(.text.doCommand+0x12): relocation truncated to fit: R_AVR_13_PCREL against symbol `setjmp' defined in .text section in / usr/local/AVRMacPack-20081213/lib/gcc/avr/3.4.6/../../../../avr/lib/ avr5/libc.a(setjmp.o)
bitlash.o: In function `my_initBitlash':
bitlash.c:(.text.my_initBitlash+0xe): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' bitlash.c:(.text.my_initBitlash+0x28): relocation truncated to fit: R_AVR_13_PCREL against `no symbol'
main.o: In function `main':
main.c:(.text.main+0x4a): relocation truncated to fit: R_AVR_13_PCREL against symbol `initBitlash' defined in .text.initBitlash section in bitlash.o main.c:(.text.main+0x50): relocation truncated to fit: R_AVR_13_PCREL against symbol `runBitlash' defined in .text.runBitlash section in bitlash.o
make: *** [main.elf] Error 1

The problem seems highly reproducible. I get similar errors with both avr-gcc 3.4.6 and avr-gcc 4.3.2 from AVRMacPack-20081213, with attiny85 and atmega168 targets. I can move the errors around by adjusting CFLAGS and LDFLAGS, and the module ordering, but they don't go away. (-lm and -lc don't help either. fyi, I use no floating point.)

The call and call target in question, in each case, are pretty far apart in the partial link map I get, but I don't understand how this could fail on the 168.

I am hoping that I've made a simple mistake that some kind soul on this list will see in a flash, but I'm beginning to wonder: Is this possibly a linker bug?

Any thoughts on how to work this forward would be most appreciated. Bitlash is an open source project so I'm happy to make the code available.

Thanks, and best regards,


-br




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

Reply via email to