[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] relocation truncated to fit: R_AVR_13_PCREL _asmfunc

From: Mattias Svensson
Subject: Re: [avr-gcc-list] relocation truncated to fit: R_AVR_13_PCREL _asmfunc
Date: Wed, 07 May 2003 17:54:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1

Joerg Wunsch wrote:

"relocation truncated to fit: R_AVR_13_PCREL _asmfunc"

It worked before when I was linking for at90s8535, now I am linking
for atmega16.

Sure.  On devices up to 8 KB of flash, an RJMP can reach the entire
flash address space.

What exactly does avr-gcc mean with: "relocation truncated to fit: R_AVR_13_PCREL _asmfunc"?

The relocation for the jump target doesn't fit into the constraints
of the instruction (supposedly, 13 bits of relative target address).

It obviously is something with the "rjmp" but what?

Use JMP instead of RJMP.

I noted that the mega16 had JMP added to the instruction set, now I see why.

Just for the record, and my understanding.
rjmp is described as: PC <- PC + k +1
and jmp as: PC <- k
So on a at90s8535 and the like that does not have jmp the linker has to calculate k at every place the rjmp is used in a way that it relatively points to the absolute address of the function jumped to...
Am I on the right track here?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]