newlib libc.a (linkr.o) problem: unresolved symbol '_link'
Tue Nov 28 16:06:00 GMT 2000
> hy all,
> i really tried hard to find info on this somewhere on the net, but something
> to be really strange about the reentrant link functions in my version of
> - cygwin latest
> - newlib 1.8.2 compiled for sh4 without troubles
> i was able to happily link all sorts of programs before, but now that I
> the snes9x code, although compiling just fine, it stops linking with one
> unresolved external that I cannot really track down, since I think it is
> to newlib itself, have a look:
> /usr/local/sh-elf/lib/ml/m4-single-only/libc.a(linkr.o): In function
> ../../../../../../../newlib-1.8.2/newlib/libc/reent/linkr.c:64: undefined
> to `_link'
> I am not very familiar what these do in newlib, so if anyone can give me any
> on how to resolve that, it would be greatly appreciated!
> thanks a lot, and keep up the great work on newlib
Newlib is designed to sit on top of a system call interface. In some cases,
the calls are provided for you in libgloss or in the libc/sys directory. In the
case of sh-elf, the syscalls are provided in libc/sys/sh/syscalls.c. There
is no _link provided.
I have attached a patch to create a stub for _link in newlib/libc/sys/sh/syscalls.c that
should solve your problem. Go to newlib/libc/sys/sh and apply the patch, then rebuild
-- Jeff J.
RCS file: /cvs/src/src/newlib/libc/sys/sh/syscalls.c,v
retrieving revision 184.108.40.206
diff -u -r220.127.116.11 syscalls.c
--- syscalls.c 2000/02/17 19:39:50 18.104.22.168
+++ syscalls.c 2000/11/29 00:02:01
@@ -37,6 +37,12 @@
return __trap34 (SYS_close, file, 0, 0);
+_link (char *old, char *new)
+ return -1;
_sbrk (int incr)
More information about the Newlib