Forum Discussion
Altera_Forum
Honored Contributor
21 years agohi trk_golf,
<div class='quotetop'>QUOTE </div> --- Quote Start --- If I use nios2-elf-gcc to compile a simple program (e.g. nios2-elf-gcc hello.c -o hello) and try to use the elf2flt utility to convert the format to flat...[/b] --- Quote End --- If you want to run hello on uClinux, you have to compile it with uClibc, not the default newlib. Therefore, here you must explicitly specify the crt0.o and libc.a from uClibc. (we do this because the tool chain is not built against uclibc, but newlib). You also need to tell the linker to generate relocatable outputs, so that elf2flt can convert them. This is done by passing "-r -d" to the linker. (You could also try "-q" to do a final link and keep the relocation records, but it was broken when I tried about half year ago). For details, please refer to the file Rules.mak for building userland applications on Cygwin. Regards, wentao Microtronix