Type: Answers

Area: Embedded

Area: Tools


IP Product: Nios Processor (Obsolete)

spl_nand.c:36: undefined reference to .elf' warning: ignoring old commands for target nios_output_memory_access', at config/nios/nios.c:2540

Description

This internal error in the GNU compiler for the Nios® processor produces compiler messages similar to the following:


arche_ds_01.c: In function `dispatch': 
arche_ds_01.c:876: Offset for st/st8d/st16d must be between -1024 and 1023: 
(insn 106 1749 107 (set (mem:QI (plus:SI (reg:SI 16 %l0) 
(const_int -13476 [0xffffcb5c])) 0) 
(reg:QI 2 %g2)) 1 {*movqi_internal} (nil) 
(expr_list:REG_DEAD (reg:QI 2 %g2) 
(expr_list:REG_DEAD (reg:SI 16 %l0) 
(nil)))) 
arche_ds_01.c:876: Internal compiler error in `nios_output_memory_access', at config/nios/nios.c:2540 
Please submit a full bug report. 
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions. 
Died at - line 85.

The work around is to reduce the size of local variables below the 1024-word limit.  To do this use the alloca() routine when declaring large local variables. 

For example, instead of the following declaration

char dummy_string[buffer_length];

use this declaration:

char* dummy_string = alloca(buffer_length);