AT91SAM9261 - customize _write() function

Hi All,

I am new guy for ARM development. I am trying to customize _write() to out in display! I have read fully on topic “How to use newlib?” and follow the method, but still fail. Please kindly advise!

“How to use newlib?” link:-

viewtopic.php?t=5390&postdays=0&postord … 03e165d0e3

My linking error:-

[src/write.c]

arm-elf-gcc -c -g -mcpu=arm9 -Wall -Iinc src/write.c -o obj/write.o -Wa,-a=lst/write.lst

[sdram: at91sam9_sdram]

arm-elf-ld -v -Map out.map -T elf32-littlearm.lds -o at91sam9_sdram.elf obj/cstartup.o obj/lowlevel.o obj/main.o obj/write.o -L d:\devtools\yagarto\arm-elf\lib -lc -lnosys -lm -lgcc

GNU ld version 2.17

d:\devtools\yagarto\arm-elf\lib\libc.a(syscalls.o): In function `_write’:

newlib-1.14.0/newlib/libc/sys/arm/syscalls.c:333: multiple definition of `_write’

obj/write.o:src/write.c:44: first defined here

arm-elf-ld: Warning: size of symbol `_write’ changed from 120 in obj/write.o to 112 in d:\devtools\yagarto\arm-elf\lib\libc.a(syscalls.o)

arm-elf-ld: cannot find -lgcc

make: *** [sdram] Error 1

make: Target `all’ not remade because of errors.

Probably there is still the default _write() implementation in the library, you should remove the default syscall.o and make your own implementation.

I would like to override _write() funciton in syscalls.o, so that prinf can be out to display.

I would like to override _write() funciton in syscalls.o, so that prinf can be out to display. Any method to do that without recompile newlib. Please kindly advise.