[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: |
Eric Weddington |
Subject: |
RE: [avr-gcc-list] dtostrf and the dreaded "relocation truncated to fit: R_AVR_13_PCREL" error |
Date: |
Fri, 06 Apr 2007 05:10:20 -0600 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of rtwas
> Sent: Friday, April 06, 2007 12:10 AM
> To: address@hidden
> Subject: [avr-gcc-list] dtostrf and the dreaded "relocation
> truncated to fit: R_AVR_13_PCREL" error
>
>
>
> gcc: avr-gcc (GCC) 4.1.1
> libc: avr-libc-1.4.4
> atmega128:
>
> Hello,
>
> On a current project, as soon as I add
>
> dtostrf(f0, 4, 4, str2);
> or
> dtostre((float) f0, str2, 4,0);
>
> to one of my source files I get:
>
>
> /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/li
> bc.a(pow.o):
> In function `pow':
> ../../../libm/fplib/pow.S:100: relocation truncated to fit:
> R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in
>
Try adding -lm to your linker command line (above) to link in the math
library from avr-libc rather than relying on libgcc.