Assuming you're not using C++, edit alt_main.c so it just contains:
void alt_main (void)
{
alt_irq_init (ALT_IRQ_BASE);
main (alt_argc, alt_argv, alt_envp);
while (1);
}
(file likely to be in directory
C:\altera\kits\nios2_51\components\altera_hal\HAL\src )
Comment out "call alt_load" in crt0.S (which might break static initialisation, or running code directly from flash, neither which I personally use)
For both the project and the syslib, set the compiler optimisation option to "minimise size".
In the system library properties, check "small C library" and "reduced device drivers" and set stdin/stdout/stderr to null.
I also edit some of the "
component.mk" files to prevent library code being sucked in. I also write my own serial I/O code (interrupt handlers).
In window\preferences, Nios-II, check "generate objdump file"; this will allow you to see what's being included in the build.
Hmmm it's about time I wrote this up (would Altera accept App-Note submissions?)