Description
This is Issue 1071 moved from a Google Code project.
Added by 2012-10-15T00:12:57.000Z by Xarq...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Defect, Priority-Medium
Original description
What steps will reproduce the problem?
- Write large program on Mega2560 with Arduino IDE 1.0.1 (typically with lots of library code)
- Get unlucky with linker placement of code making interrupt service routine too far from location 0.
- Get link error in the startup code:
"c:/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr6/crtm2560.o: In function__vector_default': (.vectors+0x5c): relocation truncated to fit: R_AVR_13_PCREL against symbol
__vector_23' defined in .text.__vector_23 section in core.a(wiring.c.o)"
What is the expected output? What do you see instead?
It should link properly, wiring.c and crtm2560.o haven't been modified and the user hasn't done anything wrong.
What version of the Arduino software are you using? On what operating
system? Which Arduino board are you using?
Arduino 1.0.1 on Windows 7 with Arduino Mega2560 board.
Please provide any additional information below.
Google for "R_AVR_13_PCREL crtm2560" and see others have reported this (and mention regressing to Arduino 1.0.0 fixes it). Since the crtm2560.o appears to have "jmp 0", but the compiled elf executable appears to have "rjmp 0 ; nop" perhaps this is a linker optimization causing this problem? I am reporting this for a user on freenode IRC #arduino channel, so I cannot post full source (and I could see this being hard to replicate as adding or removing "random" lines of code can make it crop up or disappear).