Skip to content

sketches fail to link with R_AVR_13_PCREL due to interrupt service routine too far for startup rjmp in vector [imported] #1071

Closed
@cmaglie

Description

@cmaglie

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?

  1. Write large program on Mega2560 with Arduino IDE 1.0.1 (typically with lots of library code)
  2. Get unlucky with linker placement of code making interrupt service routine too far from location 0.
  3. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: IDEThe Arduino IDEComponent: ToolchainThe tools used for compilation and uploading to Arduino boards

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions