Forum Discussion
Altera_Forum
Honored Contributor
21 years agopointer out of range link error
I have some code running from SDRAM that references an on chip RAM. In porting from NIOS to NIOS II I'm getting the link error global pointer relative address out of range I saw a topic t...
Altera_Forum
Honored Contributor
21 years agoYour first sugestion did the trick (use [])!
One thing I noticed is that when I run readelf with -s I don't see the symbol I'm referencing. I see others like __bss_start Here is the linker script portion that declares my symbol: .cpu_memory_data : { PROVIDE (_alt_partition_cpu_memory_data_start = ABSOLUTE(.)); *(.cpu_memory_data) . = ALIGN(32 / 8); PROVIDE (_alt_partition_cpu_memory_data_end = ABSOLUTE(.)); } > cpu_memory_data Here is the output of nios2-elf-readelf -s re/ssec/Debug [SOPC Builder]$ nios2-elf-readelf.exe -s project.elf | grep partition 373: 11000000 0 NOTYPE GLOBAL DEFAULT ABS _alt_partition_cpu_memory 1617: 11000000 0 NOTYPE GLOBAL DEFAULT ABS _alt_partition_cpu_memory I am referencing these symbols in the code: extern char _alt_partition_cpu_memory_data_start[]; extern char _alt_partition_cpu_memory_data_end[]; printf("start:%p end:%p\n", _alt_partition_cpu_memory_data_start, _alt_partition_cpu_memory_data_end); which works. Should this symbol show up in the readelf output? Thanks, Dan