Article ID: 000079417 Content Type: Troubleshooting Last Reviewed: 12/17/2013

Why does the error "relocation truncated to fit: R_NIOS2_CALL26" happen when Nios II code is placed in separate memory locations ?

Environment

    Nios® II Processor
BUILT IN - ARTICLE INTRO SECOND COMPONENT
Description

This error happens when functions are located in a memory location more than 256MB apart from the main memory because the Nios II compiler uses the call instruction which has 256MB boundary limitation.

 

Resolution

There are two workarounds to this issue:

1) In ACDS version 13.1, the -relax-all option is implemented to use the callr instruction instead of call instruction. In Software Build Tools for Eclipse, add the -Wa,-relax-all option in the Application or BSP properties as user flags. 

This workaround may impact the software performance as callr instruction uses more assembly instructions compared to the call instruction.

2) The call instruction does not compute the MSB 4 bits of the address , hence the 256MB boundary limitation. Locate the memories so that the MSB 4 bits of the memory base addresses are the same, to make sure the functions are within 256MB boundary.

Eg. SDRAM : 0x10000000 , onchip memory : 0x12000000

or  SDRAM : 0x08000000, onchip memory : 0x02000000

Related Products

This article applies to 1 products

Intel® Programmable Devices

1