Why ditch the system library? There are options/examples in the Nios II kit to make your software quite small.
If you do go without the system library you'll have to re-invent the wheel in several places where we've already written/optimzed the code for you.. for example, in the crt0 code executed at reset-time to initialize the caches.
If you want the smallest possible executable code try the following:
- Check out the "Hello Freestanding" Example in the IDE. This example shows commented-source-code showing how to use a system that starts in alt_main() and explains what the system library does before calling main() conventionally. This still uses a system library, but gives you more precise control over what code executes at startup. The only "lower level" you can go from there is to edit the crt0.S code for Nios II, which is physically what is executed at reset.
- Check out the "Hello World Small" Example in the IDE. This example is more pre-fabricated, usin GUI options in the IDE to automatically configure the system library to be as small as possible.
Both examples yield a hello-world of about the same size.. 3k or so if I remember correctly.