uClibc-0.9.31 for ARM, linker problem
Torsten Mohr
tmohr at s.netic.de
Tue Feb 1 22:55:43 UTC 2011
Hello,
thanks a lot for your hint.
> > I'll give it a try on my ARM target but it sounds to me very strange.
> >
> > carmelo
>
> Hi,
> I think that your toolchain is not properly configured, so it is not
> using the dynamic linker from the uClibc (where these symbols are
> defined)... I guess it is still using ld-linux.so.2.
>
> Check your toolchain configuration, especially the value of --target.
>
> Carmelo
Here are the commands i used to configure the used toolchains:
ARCH=arm
TARG=arm-linux-elf
CROSS_COMPILE=$TARG-
SYSROOT=`pwd`/sysroot
PREFIX=/opt/$TARG
export PATH=$PREFIX/bin:$PATH
for binutils i did:
../binutils-2.21/configure \
--target=$TARG \
--prefix=$PREFIX \
--disable-nls \
--enable-shared
make
make install
for gcc i did:
../gcc-4.5.2/configure \
--target=$TARG \
--prefix=$PREFIX \
--enable-languages="c" \
--disable-nls \
--disable-libssp \
--enable-shared
make
make install
for kernel-headers i did:
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE \
INSTALL_HDR_PATH=/opt/arm-linux-elf headers_install
So --targ is arm-linux-elf in all cases, which looks ok to me.
I'm not sure, but i think i'm missing something. I configured and installed
binutils, gcc and the kernel headers as described above.
Then i configured uClibc and then typed::
make CROSS=$CROSS_COMPILE
KERNEL_HEADERS=/local/armbuild/sysroot/usr/include/include V=2
It seems i need to tell the tools to use a different lib to link against?
One thing i'm not sure about, you write that you think i'm not using the
correct linker, do you mean "not using the correct lib" instead?
Trying to track the problem further down i did some more tests.
As an example, searching for _dl_app_fini_array:
tmohr at schleim:/local/armbuild/uClibc-0.9.31> grep -r _dl_app_fini_array *
ldso/ldso/dl-array.c:void _dl_app_fini_array(void);
ldso/ldso/dl-array.c:void _dl_app_fini_array(void)
Übereinstimmungen in Binärdatei ldso/ldso/ldso.oS.
Übereinstimmungen in Binärdatei ldso/ldso/ld-uClibc_so.a.
Übereinstimmungen in Binärdatei libc/misc/internals/__uClibc_main.oS.
libc/misc/internals/__uClibc_main.c:extern void _dl_app_fini_array(void);
libc/misc/internals/__uClibc_main.c://extern void weak_function
_dl_app_fini_array(void) attribute_hidden;
libc/misc/internals/__uClibc_main.c: _dl_app_fini_array();
Übereinstimmungen in Binärdatei libc/libc_so.a.
Then i was verifying the single occurrences in binary files:
/local/armbuild/uClibc-0.9.31> nm ldso/ldso/ldso.oS | grep _dl_app_fini_array
000001e4 T _dl_app_fini_array
/local/armbuild/uClibc-0.9.31> nm ldso/ldso/ld-uClibc_so.a | grep
_dl_app_fini_array
000001e4 T _dl_app_fini_array
/local/armbuild/uClibc-0.9.31> nm libc/misc/internals/__uClibc_main.oS | grep
_dl_app_fini_array
U _dl_app_fini_array
/local/armbuild/uClibc-0.9.31> nm libc/libc_so.a | grep _dl_app_fini_array
U _dl_app_fini_array
You mentioned "ld-linux.so.2" above, i searched in uClibc and in /opt/arm-
linux-elf (where my toolchain is installed) for"ld-linux*", no occurrences.
I'm not sure where the problem is, to me there is no obvious problem in the
toolchain configuration and i'm not sure about the used libs, also the
compile&install process of uClibc looked ok to me.
But i'm absolutely not sure if i'm missing something, something must be wrong.
Any hint is really appreciated.
Best regards,
Torsten.
More information about the uClibc
mailing list