"undefined ref to _DYNAMIC_LINK" problem in GNU ld
Nick Clifton
nickc@redhat.com
Fri Oct 17 10:27:00 GMT 2003
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
More information about the Binutils
mailing list