[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [bug #33698] Explicit use of RJMP/RCALL can cause "reloca
[avr-libc-dev] [bug #33698] Explicit use of RJMP/RCALL can cause "relocation truncated to fit: R_AVR_13_PCREL" linker error
Thu, 16 Feb 2012 11:10:09 +0000
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:126.96.36.199) Gecko/20100506 SUSE/3.5.10-0.1.2 Firefox/3.5.10
Follow-up Comment #7, bug #33698 (project avr-libc):
> IMO, I think the cleaner solution is to:
> 1. Improve the definition of XCALL/XJMP - at present
> it's defines call/jmp when __AVR_MEGA__ and rjmp/rcall
> otherwise. We need to correct this.
That won't catch all cases because sources use RJMP directly.
See the initial post for examples.
> 2. Like Jan Waclawek mentioned, let the linker relaxation
> optimize it, rather than changing the linker script to
> keep the math functions closer (even if we do, i wonder if
> it's going to solve the problem completely)
Keeping functions together and knowing that RCALL is always
legal can simplify the sources. There is a silicon bug that
obsoletes call-skip sequences.
For example, in libgcc we see code like the following:
;; Some cores have problem skipping 2-word instruction
sbrs A0, 7
#endif /* __AVR_HAVE_JMP_CALL__ */
1: XCALL __fmul
This must not rely on linker relaxation.
If, however, binutils ensured that functions in
section .text.libgcc and any .text.libgcc.foo are close
together, the snip above could be simplified as
sbrs A0, 7
For avr-libc this means that replacing RCALL/RJMP with
XCALL/XJMP must be done carefully if the instruction
is a skip's payload (SBRS, SBRC, SBIS, SBIC, CPSE).
Reply to this item at:
Nachricht geschickt von/durch Savannah
- [avr-libc-dev] [bug #33698] Explicit use of RJMP/RCALL can cause "relocation truncated to fit: R_AVR_13_PCREL" linker error,
Georg-Johann Lay <=