_dl_app_init_array and _dl_app_fini_array problems

Kevin Day thekevinday at gmail.com
Thu Sep 28 21:41:40 UTC 2006


Running on a uClibc-0.9.28 (hlfs-style) host, I have been attempting
to build a toolchain to see what does/does not build with the
svn/0.9.29tobe.
gcc-4.1.1

I ran into this problem in each svn I tried, with the svn versions
picked based only on the number of errors/no-error logs you make for
an i386 machine as reported on the list.

So, for purposes of reporting this I picked the 20060927 version.

After compiling the toolchain with as a shared library, I had the
following two problems:

1)  libc.so is not a file, but the following:
/* GNU ld script
 * Use the shared library, but some functions are only in
 * the static library, so try that secondarily. */
GROUP ( /tools/lib/uclibc_nonshared.a /tools/lib/libc.so.0  )

I never noticed this until later in the toolchain creation process, I
found that my libraries where still linking to the host libc.

So my passes after that, after installing uClibc (make install) I
would overwrite the libc.so as a symlink to libc.so.0

Once that was done the second problem occured.

2)    _dl_app_init_array and _dl_app_fini_array were not found when
trying to link anything against libc.so.  with readelf, I found that
those two had the UND tags.

Also note that I found the following with UND tags:
__pthread_initialize_mini
__dso_handle
__pthread_once

here are the lines:
95: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __pthread_once
89: 00000000    40 FUNC    GLOBAL DEFAULT  UND _dl_app_init_array
321: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __dso_handle
596: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __pthread_initialize_mini
998: 00000000    40 FUNC    GLOBAL DEFAULT  UND _dl_app_fini_array
2827: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __pthread_once
2921: 00000000    40 FUNC    GLOBAL DEFAULT  UND _dl_app_init_array
3053: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __dso_handle
3328: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __pthread_initialize_mini
3730: 00000000    40 FUNC    GLOBAL DEFAULT  UND _dl_app_fini_array

The WEAK calls are probably unrelated, my main concern are the GLOBAL.
Still I am quite uncomfortable of having any UND in a libc.so


any help on fixing this _dl_app_{init,fini}_array problems?
-- 
Kevin Day



More information about the uClibc mailing list