An issue has been identified with the linker script generated by the 11.1 version of the Nios® II Board Support Package (BSP) generator. The issue leads to link errors similar to the following:
/opt/altera/11.0sp1/nios2eds/bin/gnu/H-i686-pc-linux-gnu/bin/。/lib/gcc/nios2-elf/4.1.2/。/../../../nios2-elf/lib/libstdc .a (locale.o):在功能中 'std::locale:id::_M_id() const':
/build/swbuild/SJ/nightly/11.0sp1/208/l32/work/ip/sopc/app/gnu/BUILD/gnu/build-0-gcc.nios2-elf.i686-pc-linux-gnu/nios2-elf/libstdc -v3/src/。/../../../src/gcc-4.1/libstdc -v3/src/locale.cc:436:警告:无法从全球指 0x00d217f0针到达 (null)(0x00e77e74),因为偏移量 (1402500) 不在允许的范围之外,-32678 到 32767。
要解决此问题,在 BSP 中打开 linker.x 链接器脚本,并编辑以下行:
.rwdata LOADADDR (.rodata) SIZEOF (.rodata) : AT ( LOADADDR (.rodata) SIZEOF (.rodata) SIZEOF (.rwdata) )
删除最后一个 SIZEOF (.rwdata) 指令,以正确定义 .rwdata 部分,如下所示:
.rwdata LOADADDR (.rodata) SIZEOF (.rodata) : AT ( LOADADDR (.rodata) SIZEOF (.rodata) )
此问题应在面向Eclipse的Nios II软件构建工具的将来版本中修复。