Hi, Eric:
Thanks for your note. You noticed my compiler flag cruft; sorry -
below is how it looks without the flag-flailing.
The first make is a Tiny85 build with no flags - this is where the
problem first showed up and as you see it is reproducible in this case.
The second make is the same code building for the Mega168, also no
flags. That build appears to succeed with several hundred bytes of
headroom left below the hypothetical 8k code limit (at least as
generated for the '168):
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
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=attiny85 -c eeprom.c -o eeprom.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=attiny85 -c bitlash.c -o bitlash.o
bitlash.c: In function `getfunction':
bitlash.c:1044: warning: unused variable `deadbeef_seed'
bitlash.c:1045: warning: unused variable `deadbeef_beef'
bitlash.c:1075: warning: unused variable `arg3'
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=attiny85 -c main.c -o main.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=attiny85 -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=attiny85 -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=attiny85 -Wl,-Map=main.map,--cref -o main.elf usbdrv/usbdrv.o -lc
usbdrv/usbdrvasm.o main.o bitlash.o eeprom.o
bitlash.o: In function `getString':
bitlash.c:(.text+0x1c8): relocation truncated to fit: R_AVR_13_PCREL
against symbol `eeread' defined in .text section in eeprom.o
bitlash.o: In function `getmsg':
bitlash.c:(.text+0x206): relocation truncated to fit: R_AVR_13_PCREL
against symbol `strlen_P' defined in .text section in /usr/local/
AVRMacPack-20081213/lib/gcc/avr/3.4.6/../../../../avr/lib/
libc.a(strlen_P.o)
bitlash.o: In function `hexval':
bitlash.c:(.text+0x2fe): relocation truncated to fit: R_AVR_13_PCREL
against symbol `tolower' defined in .text.ctype section in /usr/local/
AVRMacPack-20081213/lib/gcc/avr/3.4.6/../../../../avr/lib/
libc.a(tolower.o)
bitlash.o: In function `runBackgroundTasks':
bitlash.c:(.text+0x1158): relocation truncated to fit: R_AVR_13_PCREL
against `no symbol'
bitlash.o: In function `initBitlash':
bitlash.c:(.text+0x1200): relocation truncated to fit: R_AVR_13_PCREL
against `no symbol'
bitlash.o:(.progmem.gcc_sw_table+0x0): relocation truncated to fit:
R_AVR_13_PCREL against `no symbol'
bitlash.o:(.progmem.gcc_sw_table+0x2): relocation truncated to fit:
R_AVR_13_PCREL against `no symbol'
bitlash.o:(.progmem.gcc_sw_table+0x4): relocation truncated to fit:
R_AVR_13_PCREL against `no symbol'
bitlash.o:(.progmem.gcc_sw_table+0x6): relocation truncated to fit:
R_AVR_13_PCREL against `no symbol'
bitlash.o:(.progmem.gcc_sw_table+0x8): relocation truncated to fit:
R_AVR_13_PCREL against `no symbol'
bitlash.o:(.progmem.gcc_sw_table+0xa): additional relocation overflows
omitted from the output
make: *** [main.elf] Error 1
firmware bill$
firmware bill$ # now for the '168:
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
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=atmega168 -c eeprom.c -o eeprom.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=atmega168 -c bitlash.c -o bitlash.o
bitlash.c: In function `getfunction':
bitlash.c:1044: warning: unused variable `deadbeef_seed'
bitlash.c:1045: warning: unused variable `deadbeef_beef'
bitlash.c:1075: warning: unused variable `arg3'
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=atmega168 -c main.c -o main.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=atmega168 -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=atmega168 -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
avr-gcc -Wall -Os -DF_CPU=16500000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -
mmcu=atmega168 -Wl,-Map=main.map,--cref -o main.elf usbdrv/usbdrv.o -
lc usbdrv/usbdrvasm.o main.o bitlash.o eeprom.o
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
avr-size main.hex
text data bss dec hex filename
0 7802 0 7802 1e7a main.hex
avr-objdump -S main.elf > main.lss
firmware bill$
I have received advice to make the total code size smaller and keep
trying, which I shall do.
Any further thoughts on where to dig on this one would be most
appreciated.
Cheers,
-br
On Jan 25, 2009, at 9:25 AM, Weddington, Eric wrote:
-----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 23, 2009 7:14 AM
To: avr-gcc-list@nongnu.org
Subject: [avr-gcc-list] Advice on R_AVR_13_PCREL errors
linking for Tiny85_and_ Mega168?!
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:
This is a shot in the dark. What do you get when you remove these
two compiler flags (and you rebuild all)?:
-mshort-calls -mno-tablejump
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list