[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#227906: libc6: Failed assertion in ld.so



On Fri, Jan 23, 2004 at 06:04:49PM +0300, Vladimir Prus wrote:
> Daniel Jacobowitz wrote:
> 
> > > > The shared library you open, if it is correctly built, will reference
> > > > shared libc.so.6, causing libc.so.6 to be dlopen'd into your
> > > > application.  If it mismatches the included version of glibc unknown
> > > > things will happen, and in the past, have happened.
> > >
> > > OTOH, I the library is built with static libc, there's no problem. Of
> > > course, unless two statically linked copies of libc will decide to have a
> > > fight -- and I don't know if they will.
> >
> > You didn't read what I said correctly.  The dlopened library will be
> > _dynamically_, not statically, linked with libc.  So you end up with a
> > static copy and a dynamic copy - boom.
> 
> In my experiment, I've created a library on which ldd says:
> 
>    bash-2.05b$ ldd lib.so
>            statically linked
> 
> Or are you saing that even though library itself does not reference dynamic 
> libraries, the fact that it's opened with dlopen will link it to libc 
> dynamically, because that's how dlopen works?

I don't think you're even going to be able to dlopen that.  Certainly
it's not supported.

[Not that ldd is the right tool for this.  You should be using readelf
if you're going to play with the guts of dynamic linking.  It depends
WHY ldd thinks it's not dynamically linked.]

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: