Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

The Nios II Error

When I build the helloworld,an error occured:

Compiling hello_world.c...

Linking hello_world_0.elf...

/cygdrive/d/altera/80/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: region onchip_mem is full (hello_world_0.elf section .text). Region needs to be 37260 bytes larger.

/cygdrive/d/altera/80/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: region onchip_mem is full (hello_world_0.elf section .bss). Region needs to be 320 bytes larger.

/cygdrive/d/altera/80/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: address 0x4140 of hello_world_0.elf section .onchip_mem is not within region onchip_mem

/cygdrive/d/altera/80/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .rodata [00002020 -> 000024ff] overlaps section .exceptions [00002020 -> 000021c7]

/cygdrive/d/altera/80/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .rwdata [00002500 -> 00003f2b] overlaps section .text [000021c8 -> 0000d18b]

/cygdrive/d/altera/80/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .bss [00003f2c -> 0000413f] overlaps section .text [000021c8 -> 0000d18b]

collect2: ld returned 1 exit status

make: *** [hello_world_0.elf] Error 1

The onchipmem is 8kBytes,and the cpu is standard.Who can tell me what's the meaning above?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Your on-chip memory is too small. It looks like you'll need 64K. Make your on-chip memory bigger, or try to shrink the size of your code (use smallc library, etc.)