- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I want to add a large data section into a sdram executable file.
I think objcopy is the way to do it. mydata.dat is my binary data file.nios2-elf-objcopy -I binary mydata.dat -O elf32-littlenios2 mydata.o
objdump shows the contents of the file nios2-elf-objdump -s mydata.o
mydata.o: file format elf32-little
Contents of section .data:
0000 6e756c6c 20746572 6d696e61 74656420 null terminated
0010 61736369 69207465 78742064 61746120 ascii text data
0020 66696c65 file
How to link mydata.o into the rest of the project, is it enough to copy it to the project folder? How to get a pointer to the .data section of the object file for the c code? I use the eclipse based nios2 ide.
링크가 복사됨
1 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
This topic has already been discussed at least in here:
forum topic (http://forum.niosforum.com/forum/index.php?showtopic=1880&pid=7553&mode=threaded&show=&st=&#entry7553) I was able to link the object to the memory image file by adding the object file name to the linker command options. If the object file has been successfully linked, it should appear in the project.map file. How to tell the linker to make a map file is discussed here: map file entry (http://forum.niosforum.com/forum/index.php?showtopic=312&pid=1232&mode=threaded&show=&st=&#entry1232) And from the c/c++ code i can access the memory are by accessing it as an array type. _binary_test_txt_start is a symbol in the .map file. extern char _binary_test_txt_start[];