tic6x: relocation truncated to fit: R_C6000_PCR_S21

Timon ter Braak timon@terbraak.org
Thu Feb 14 09:34:00 GMT 2013


By now I have read up on the C6000 EABI, which gives me some 
clarification on the issue itself.

A branch instruction with a displacement (label) takes only 21 bits 
(shifted left 2 bits to get 4MB limit).
The instruction is intended for local branches (manual says withinone  
same function).

For a 32-bit displacement, 2 MVK{L,H} instructions are needed to load 
the displacement into a register,
followed by a branch instruction (upon that register).

Can anyone give me some pointers on how to instruct the assembler, or 
linker to generate different branch/call instructions?

On 02/08/2013 01:18 AM, Joseph S. Myers wrote:
> On Thu, 7 Feb 2013, Timon ter Braak wrote:
>
>> Hi,
>>
>> I have a toolchain for the TI C64x DSP with binutils 2.23.1. It
>> generates valid executables for 'toy examples', but for a larger (but
>> still reasonable) code size, I get relocation problems:
>>
>> /target/lib/gcc/c6x-uclinux/4.7.2/crtbegin.o:(.fini+0x0): relocation
>> truncated to fit: R_C6000_PCR_S21 against `.text'
> That sounds like an issue with the linker (maybe default linker scripts)
> placing sections too far apart; reasonable code size examples should not
> get out of range for this relocation.
>



More information about the Binutils mailing list