Forum Discussion
Altera_Forum
Honored Contributor
21 years agoI have a similar problem where I want to put an array at a fixed ram location for dual-port access. I have put my array in its own c source as smcnutt suggested
File spectrRam.c -> unsigned long spect[1024]; Created a linker command file file linkerCmds.txt ->SECTIONS{
.fixed.struct 0x00004000 :
{
obj/spectrRam.o (.bss)
}
} But the problem is to get the linker to accept the commands, because as I get from another forum thead, the linking is done by the nios2-elf-gcc NOT the linker, so for instance to get a Map generated one has to use the compiler option -Wl,-Map,myMapFile.map to get a mapfile created in the project directory. Along this line I have tried -Wl,-T,linkerCmds.txtas well as-Wl,-Map,myMapFile.map,-T,linkerCmds.txt in order to get a Map handy for verification of success, but it seems not to work. The build gives info like nios2-elf-gcc -xc -MD -c -DSYSTEM_BUS_WIDTH=32 -Dexit=_exit -I.. -IC:/PC6479/a_fft/software/peakFind_syslib/Debug/system_description -I/cygdrive/c/Programs/altera/kits/nios2/components/altera_nios2/HAL/inc -I/cygdrive/c/Programs/altera/kits/nios2/components/altera_hal/HAL/inc -D__hal__ -DALT_DEBUG -Wl,-T,linkerCmds.txt -O0 -g -Wall -o obj/spectrRam.o ../spectrRam.c
nios2-elf-gcc: -T: linker input file unused because linking not done
nios2-elf-gcc: linkerCmds.txt: linker input file unused because linking not done So the linker is not called/used and the compiler does not recognize the command. Have you a suggestion how to get this solved? I have to say that I am an absolute newcomer to gnu tools.