[En-Nut-Discussion] relocation truncated to fit: R_ARM_PC24

Harald Kipp harald.kipp at egnite.de
Tue Oct 5 19:32:16 CEST 2010


On 05.10.2010 16:06, Michael Jones wrote:
> at91_efc.c:(.text+0xb8): relocation truncated to fit: R_ARM_PC24 against symbol `At91EfcCmd' defined in .ramfunc section in ...\libnutarch.a(at91_efc.o)
> collect2: ld returned 1 exit status

A vague guess: The compiler generates a call, which allows a 24 bit
offset only, but the distance between your flash code and the RAM
requires a larger offset.

To fix it immediately you may try the following hack:

1. Create a local copy of at91_efc.c in your app dir.
2. Compile it individually, adding the compile option -mlong-calls
3. Link the local at91_efc.o before linking libnutarch.a

Mh... right now I do not have the slightest idea how to solve this
generally.

I remember, that André Riesberg added the missing .ramfunc segment to
several linker scripts. Possibly he stumbled over the same problem and
already found a solution.

André? Are you listening?

Regards,

Harald



More information about the En-Nut-Discussion mailing list