Forum Discussion
Altera_Forum
Honored Contributor
13 years agoelf size too large for hello world application
Hi All, i am new to Altera's Nios-II, so as usual started with hello world template i am able to build it but the elf size is comes about 677274 bytes after applying all the optimizations (acc...
Altera_Forum
Honored Contributor
13 years agoBasically printf() pulls in a large amount of library code from libc.
There is a 'small BSP' template which will give a much smaller image, I think you than have to use alt_printf(). If you look carefully at the generated program, you'll find that the actual entry point is alt_main() - which does a load of setup (of stdio etc) before calling your main() function. You can avoid most of it by calling your code alt_main() ! A C program to read switches and change LEDs can be very small indeed - but last I looked (some time ago) Altera don't make that one easy to generate.