I am trying to compile a thumb code using gcc (from GNU Tools ARM Embedded).
by typing the command line gcc.exe C:\foo.c -o foo.o -mthumb
I get the following errors:
c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-exit.o): In function
exit': exit.c:(.text.exit+0x1a): undefined reference to
_exit' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-sbrkr.o): In function_sbrk_r': sbrkr.c:(.text._sbrk_r+0xc): undefined reference to
_sbrk' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-writer.o): In function_write_r': writer.c:(.text._write_r+0x10): undefined reference to
_write' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-closer.o): In function_close_r': closer.c:(.text._close_r+0xc): undefined reference to
_close' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-lseekr.o): In function_lseek_r': lseekr.c:(.text._lseek_r+0x10): undefined reference to
_lseek' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-readr.o): In function_read_r': readr.c:(.text._read_r+0x10): undefined reference to
_read' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-fstatr.o): In function_fstat_r': fstatr.c:(.text._fstat_r+0xe): undefined reference to
_fstat' c:/program files (x86)/gnu tools arm embedded/5.2 2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-isattyr.o): In function_isatty_r': isattyr.c:(.text._isatty_r+0xc): undefined reference to
_isatty' collect2.exe: error: ld returned 1 exit status
How can I solve these errors?