This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: tic6x: relocation truncated to fit: R_C6000_PCR_S21


On Thu, 14 Feb 2013, nick clifton wrote:

> Hi Timon,
> 
> > Can anyone give me some pointers on how to instruct the assembler, or
> > linker to generate different branch/call instructions?
> 
> The usual method is called "relaxation".  You have the compiler, or assembler,
> generate the longest instruction sequence, ie one that is guaranteed to work
> no matter what the offset.  Then in the linker, once the actual offset is
> known, you "relax" the instruction sequence, replacing it with a smaller
> sequence, if that is viable.

You can't generally replace sequences by smaller ones, or really 
manipulate them at all in the assembler or linker, because of the exposed 
pipeline.  The most plausible approach is for the linker to make long 
branches branch to a veneer the linker generates.  But it would be odd to 
have more than 4MB of code on C6X, so my first suspicion remains that 
actually you have something wrong with how the linker is laying out code, 
and that you need to fix that problem so that the < 4MB of real code is 
all contiguous in the address space as it should be - and you don't need 
to implement long-branch veneers.

-- 
Joseph S. Myers
joseph@codesourcery.com


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