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: #ifdef __AVR_ERRATA_SKIP_JMP_CALL__ ;; Some cores have problem skipping 2-word instruction tst A0 brmi 1f #else sbrs A0, 7 #endif /* __AVR_HAVE_JMP_CALL__ */ XJMP __fmul 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 XJMP __fmul XCALL __fmul 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: <http://savannah.nongnu.org/bugs/?33698> _______________________________________________ Nachricht geschickt von/durch Savannah http://savannah.nongnu.org/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev