Non code-related error while compiling

Hi guys,

I was working on a project, currently implementing SPI communication, when I tried to compile my code and got this error:

c:/users/<path to my arduino>/arduino-1.0.5-r2-windows/arduino-1.0.5-r2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr6/crtm2560.o: In function `__vector_default':
(.vectors+0xcc): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_51' defined in .text.__vector_51 section in core.a(HardwareSerial.cpp.o)

At first when I changed nothing but the value of the register I was trying to transmit in it started working again, but now I can do what I want but the code won't compile anymore.

I'm working with an old version of arduino (1.0.5-r2) because the board (CrumbuinoMega) requires some Add-ons that only work with these old versions.

Since the error is not referencing any of my code I would like to ask if this happend before and what I can do to fix this.

Thanks for replies,
__rian

That's a bug in the linker in the old compiler toolchain used with the 1.0.x arduino versions. The issue is fixed in current versions of the IDE. It's putting (or trying to put) the ISR for serial events in a location in the flash where it can't be reached correctly.

Either upgrade to 1.6.x, or get 1.6.x and replace the 1.0.x toolchain with the new one.

Thanks, replacing the toolchain worked just fine!