This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: "undefined ref to _DYNAMIC_LINK" problem in GNU ld
- From: Nick Clifton <nickc at redhat dot com>
- To: Tao Zhang <zhangtao at cc dot gatech dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 17 Oct 2003 11:22:29 +0100
- Subject: Re: "undefined ref to _DYNAMIC_LINK" problem in GNU ld
- References: <Pine.GSO.4.58.0310102100460.1493@gaia.cc.gatech.edu>
Hi Tao,
> Now it seems the cross compiler can generate object files (not extensively
> tested yet), but the linker doesn't work. When linking a file, it gives
> the following error messages:
>
> LIBDIR/lib/libc.a(init_libc.o): In function `__pthreadAtomThreaded':
> init_libc.o:784: undefined reference to `_BASE_ADDRESS'
> init_libc.o:784: undefined reference to `_DYNAMIC_LINK'
>
> LIBDIR/lib/libc.a(ldr_atexit.o): In function `__ldr_atexit':
> ldr_atexit.o:101: undefined reference to `_DYNAMIC_LINK'
>
> These symbols should be defined by the loader, but maybe GNU ld doesn't do
> that? These symbols look related with shared libraries, but I don't need
> shared library support at all.
>
> Does anybody know how to get around this problem? Maybe manually define
> these symbols in GNU ld?
The simplest way to resolve this would be to define these symbols in a
linker script and then include that script at link time. See the
linker documentation for how to do this.
Cheers
Nick