Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12436 Discussions

Linking error in Nios II .elf file

Altera_Forum
Honored Contributor II
4,008 Views

Hi, 

 

The following errors occur when i try to build a simple "hello world" application. 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: Hello_world_0.elf section `.text' will not fit in region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x46f4c of Hello_world_0.elf section `.rwdata' is not within region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x48c74 of Hello_world_0.elf section `.bss' is not within region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x48c74 of Hello_world_0.elf section `.onchip_memory2' is not within region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x46f4c of Hello_world_0.elf section `.rwdata' is not within region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x48c74 of Hello_world_0.elf section `.bss' is not within region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x48c74 of Hello_world_0.elf section `.onchip_memory2' is not within region `onchip_memory2' 

 

c:/altera/11.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: region `onchip_memory2' overflowed by 31860 bytes 

 

Any help would be greatly appreciated.  

 

Thanks
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
463 Views

The 'hello world' example pulls in a lot of libc - IIRC it is about 70k code - probably larger than your internal memory. 

 

You need to select the small libc.
Altera_Forum
Honored Contributor II
463 Views

That worked. I had to create a new project with the small lib template, but this work fine. Thanks for your help!

Altera_Forum
Honored Contributor II
463 Views

This is incredible, I made the shortest program I've ever made and received this error with a 20kbyte memory. I had to switch to Small C Library too (BSP properties). Is there any documentation about the implications of this option?

Altera_Forum
Honored Contributor II
462 Views

Everybody does it :-) Feels like taking a trip on a time machine somewhere to 80s, right? :-D

Altera_Forum
Honored Contributor II
462 Views

Hi All 

I've the same issue.... :-( But I'm not able to create a small C library, could you please explain to me where can i find this option? 

 

Is it also possible to load all into DDR ram? 

I'm at 87.9 mph but I can't go haed...
Altera_Forum
Honored Contributor II
463 Views

I've found the small C library, but is it included printf function? 

Thanks
Altera_Forum
Honored Contributor II
463 Views

Can't you check?

Altera_Forum
Honored Contributor II
463 Views

printf() is excluded from the small C library because it pulls in quite a lot of dependand code (basically all the stdio code and malloc/free). 

It is possible to write a standalone snprintf() that is under 1800 bytes (without long long or FP support) - does need __udivsi3 though. 

 

IIRC the small C library does contains some functions to print strings.
Altera_Forum
Honored Contributor II
463 Views

Really thanks 

 

very good information, but I can't find documentation related to IIRC, could you please help me. I would like to study something useful... 

Thanks
Altera_Forum
Honored Contributor II
463 Views

Hi All 

 

Now I can see on my LCD many strange characters only on the first row. I've performed the basic procedure for clear start from position 0 and print same characters. But the result is completely different from desired, Very strange characters are shown by first row,nothing on the second row. 

Coud someone help me? 

How is it possible? 

where can i study something? 

Thanks
Reply