# AT91SAM9261 - customize \_write() function

**URL:** <https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [November 15, 2007, 4:22am UTC](https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746 "2007-11-15T04:22:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DummyPo](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@DummyPo](https://community.sparkfun.com/u/DummyPo)\
**Post date:** [November 15, 2007, 4:22am UTC](https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746/1 "2007-11-15T04:22:59Z")

</div>

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](http://forum.sparkfun.com/viewtopic.php?t=5390&postdays=0&postorder=asc&start=15&sid=01422ee0aa76eee5510ade03e165d0e3)

---

<div class="post-metadata">

**Author:** ![DummyPo](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@DummyPo](https://community.sparkfun.com/u/DummyPo)\
**Post date:** [November 15, 2007, 4:40am UTC](https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746/2 "2007-11-15T04:40:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gdisirio](https://avatars.discourse-cdn.com/v4/letter/g/c4cdca/32.png) [@gdisirio](https://community.sparkfun.com/u/gdisirio)\
**Post date:** [November 15, 2007, 10:02am UTC](https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746/3 "2007-11-15T10:02:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DummyPo](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@DummyPo](https://community.sparkfun.com/u/DummyPo)\
**Post date:** [November 15, 2007, 1:42pm UTC](https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746/4 "2007-11-15T13:42:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DummyPo](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@DummyPo](https://community.sparkfun.com/u/DummyPo)\
**Post date:** [November 15, 2007, 1:45pm UTC](https://community.sparkfun.com/t/at91sam9261-customize-write-function/5746/5 "2007-11-15T13:45:35Z")

</div>

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.
