This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: relocation truncateds to fit R_ARM_PC24
- To: ananda dot motte at philips dot com
- Subject: Re: relocation truncateds to fit R_ARM_PC24
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 09 Nov 2001 09:36:21 +0000
- Cc: binutils at sources dot redhat dot com
- References: <OF58B129CD.BF70C5D2-ONC1256AFE.0044C556@diamond.philips.com>
Hi Ananda,
> .FLASHROM 0x08000000 :{
> Startup.o(.StartupArea)
> .DRAM 0xC0700000 : AT(_eStartupArea){
> *(.text)
> I also get
> Startup.o(.StartupArea+0xc): relocation truncated to fit: R_ARM_PC24
> __gccmain
> Why ? what's the solution ?
The "relocation truncated to fit" message means that the destination of
a BL instruction is too far away. In the case of the example above,
this means that the BL instruction is in the .FLASHROM section located
at 0x08000000 and the __gccmain function is in the .text section,
located at 0xC0700000. The distance between these two sections is
0xC0700000 - 0x08000000 = 0xB8700000. The BL instruction only has a
24-bit (signed) offset field so 0xB8700000 is too big to fit into this
field.
The solution is to move the sections closer together, or to use long
calls. (Compile Startup.o with -mlong-calls).
Cheers
Nick