This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: relocation truncateds to fit R_ARM_PC24


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]