[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] dtostrf and the dreaded "relocation truncated to fit:
From: |
Dmitry K. |
Subject: |
Re: [avr-gcc-list] dtostrf and the dreaded "relocation truncated to fit: R_AVR_13_PCREL" error |
Date: |
Fri, 6 Apr 2007 18:15:06 +1100 |
User-agent: |
KMail/1.5 |
On Friday 06 April 2007 17:10, rtwas wrote:
> gcc: avr-gcc (GCC) 4.1.1
> libc: avr-libc-1.4.4
[...]
> /usr/local/atmel/bin/avr-gcc -g -Os -Wall -mcall-prologues
> -mmcu=atmega128 -save-temps main.o spim.o spim_tmr0.o diag.o uart.o
> cmd.o cmd_spi.o -o avr_sdiag0.obj
> /usr/local/atmel/lib/gcc/avr/4.1.1/../../../../avr/lib/avr5/libc.a(pow.o):
[...]
Oops!
Just now I have noticed, that all math functions are
simultaneously in both libraries: libc and libm.
Look CVS:
Revision 1.1.2.7
Fri May 7 17:38:27 2004 UTC by troth
* AvrCommonLibC.am (nodist_libc_a_SOURCES): Add libm.a sources to
libc.a so that float point libs are available even if the end user
forgets to use the -lm to link to the math lib.
It is error! Before this it is needed to exclude *all*
short jmp/calls from fplib group!
I objects to this:
* Modules are strongly interconnected. The quantity of
short transitions is very great (in comparison with usual
programs), and their replacement considerably will worsen
speed and the size.
* It excludes an opportunity to take advantage of high
quality arithmetics which gives the compiler.
However, before to correct this, it is necessary to test
all cases: we have libc functions which use a floating arith.
Dmitry.
P.S. Robert, place '-lm' after all object files to avoid error.
If this will not help, try: '-lm -lc -lm'.