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: คําเตือน: ไม่สามารถไปถึง (null) (ที่0x00e77e74) จากตัวชี้ส่วนกลาง (ที่0x00d217f0) เนื่องจากออฟเซ็ต (1402500) อยู่นอกช่วงที่ได้รับอนุญาต -32678 ถึง 32767
ในการแก้ไขปัญหานี้ ให้เปิดสคริปต์ linker.x ใน BSP และแก้ไขบรรทัดต่อไปนี้:
.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) )
ปัญหานี้จะได้รับการแก้ไขในเวอร์ชันในอนาคตของเครื่องมือสร้างซอฟต์แวร์Nios IIสําหรับEclipse