[En-Nut-Discussion] Ethernut 3 linking problem: multiple definitions and undefined references

José Vallet jose.vallet at hut.fi
Fri Feb 27 15:40:36 CET 2009


Problems solved.

José Vallet wrote:
> * PROBLEM 1: multiple definitions of `_close', `_write', `_read' and 
> `_open'.
> __________________
> /usr/arm-elf/lib/libc.a(syscalls.o): In function `_close':
> ../../../../.././newlib/libc/sys/arm/syscalls.c:432: multiple definition 
> of `_close'
> /home/jose/ethernut/ethernut-4.4.0-bld/lib/libnutcrt.a(close.o):close.c:(.text+0x0): 
> first defined here
> /usr/arm-elf/bin/ld: Warning: size of symbol `_close' changed from 60 in 
> /home/jose/ethernut/ethernut-4.4.0-bld/lib/libnutcrt.a(close.o) to 16 in 
> /usr/arm-elf/lib/libc.a(syscalls.o)
> __________________

We finally found the problematic function that was triggering the linker 
complains by commenting out code until the linker stopped complaining. 
Then we could blame directy to "strtod", and thus starting suspecting 
something related to float point support in ARM. Finally we realized 
that it was somehow broken for the OS version that we were using 
(4.4.0), and using the latest stable release (4.6.4) solved the problem. 
So there was no need to include any extra function implementation in our 
app code.

> * PROBLEM 3: undefined reference to `end'
> The message from the linker is
> __________________
> /usr/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/libc.a(syscalls.o): 
> In function `_sbrk':
> syscalls.c:(.text+0xdc): undefined reference to `end'
> __________________

This was related to the problem 1, as _sbrk is a fucntion added to the 
Nut/OS libraries used by newlib to request heap space. It was also 
solved by upgrading to version 4.6.4


Regards
José




More information about the En-Nut-Discussion mailing list