libgcc_s.so is unnecessarily linked for MIPS

Kishore K hellokishore at gmail.com
Thu Jun 15 11:06:29 UTC 2006


On 6/15/06, Peter S. Mazinger <ps.m at gmx.net> wrote:
>
> On Wed, 14 Jun 2006, David Daney wrote:
>
> > Erik Andersen wrote:
> > > On Wed Jun 14, 2006 at 05:56:16PM -0700, David Daney wrote:
> > >
> > >> As I said before, I am wondering also.  It works on a glibc system,
> and
> > >> is broken on a uClibc system.  Not to say that uClibc is causing it,
> but
> > >> there is a correlation.
> > >>
> > >
> > > Buildroot builds gcc with the '--enable-shared' option.
> > >
> > > $ ./configure --help | grep libgcc
> > >   --disable-shared        don't provide a shared libgcc
> > >
> > > If you edit buildroot/toolchain/gcc/gcc-uclibc-3.x.mk
> > > and tell it to use --disable-shared it will not use a
> > > shared libgcc, but instead staticly link libgcc.a into
> > > each app (which may or may not use any libgcc symbols).
> > >
> > >
> > While all that is certainly true, the simple hello world program should
> > be able to be linked with a tool chain configured with --enable-shared
> > *without* having a DT_NEEDED entry for libgcc_s.so.1.  That it does not
> > indicates that there is a bug somewhere in the tool chain.
> >
> > do this : mipsel-linux-gcc -v -o hello-world hello-world.c
> >
> > And you will see that in the linking stage, you have two instances of
> > '--as-needed -lgcc_s --no-as-needed'.  This tells the linker
> > (mipsel-linux-ld) to *only* set a DT_NEEDED for libgcc_s.so.1 *if* it is
> > required to resolve an undefined symbol in the hello-world executable.
>
> wondering if this could be related to an --as-needed bug fixed in the past
> 2 weeks in binutils-cvs
>
> Peter


May not be. I tried with two other binutils versions (2.17.50.0.1 &
2.16.91.0.7), but ended up with the same result.

--kishore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/uclibc/attachments/20060615/b7d8aada/attachment.htm 


More information about the uClibc mailing list