Linking with -lc

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Thu May 8 08:42:00 GMT 2003


At 21:47 07.05.2003, H. J. Lu wrote:
>On Wed, May 07, 2003 at 03:38:49PM -0400, Harris, Jeff wrote:
> > The output from the objdump command is:
> >
> > 00114fa4 g    DF .text  00000894  GLIBC_2.3.2 __muldf3
>
>This definitely is wrong. __muldf3 in glibc should be for backward
>compatibility only. Someone working on pcc should take a look at
>sysdeps/powerpc/nofpu/Versions and fix them similar to the way in
>sysdeps/powerpc/powerpc32/libgcc-compat.S.

Argh, this somehow passed me by. This means glibc-2.3.2 is quite broken in 
the ppc-nofpu case. If these symbols are exported at all from glibc, they 
shouldn't be exported as default symbols. So at least a libgcc-compat.S is 
needed here (a Version script extension to create a non-default versioned 
symbol would be nice), even better would be to remove the symbols from the 
Versions file again, I don't think there are glibc-2.3.2 based nofpu 
distros out there, so that should be fine. What was the reasoning to add 
these symbols in the first place?

> > I didn't mention in my original email, but linking with -lgcc before -lc
> > works.  This is what happens when gcc calls ld from the output of gcc -v.
> >
>
>I will see if I can reproduce it on Linux/x86. I suspect it is a ppc
>specific bug.

That's normal behaviour, libgcc has all these symbols and gcc correctly 
links '-lgcc -lc -lgcc', but adding -lc to the gcc link line undos that and 
then breaks with a the broken glibc-2.3.2.

Franz.



More information about the Libc-alpha mailing list