[PATCH] nptl: proper soname handling

Rob Landley rob at landley.net
Mon Apr 26 13:53:38 UTC 2010


On Thursday 22 April 2010 05:10:41 Michael Deutschmann wrote:
> On Thu, 22 Apr 2010, Natanael Copa wrote:
> > Do you have any better suggestions how to upgrade a running system?
>
> First, build the new uClibc, but don't install it yet.
>
> Build a customized ld-uclibc.so.0, from the previous uClibc source, that
> looks in a different place for shared libraries and ignores the
> /etc/ld.so.* files.  Install it under a different filename.

Or just build it that way in the first place...

> Write a utility to modify the INTERP filename specified in an executable
> from "/lib/ld-uclibc.so.0" to the filename of the special ld.so.  (This is
> much simpler if the temporary ld.so filename is the same length as the
> original.)

Try "probably only feasible if". 

Also, note that the library paths the linker searches internally aren't 
necessarily obvious:

        /* Lastly, search the standard list of paths for the library.
           This list must exactly match the list in uClibc/ldso/util/ldd.c */
        _dl_if_debug_dprint("\tsearching full lib path list\n");
        tpnt1 = search_for_named_library(libname, secure,
                                        UCLIBC_RUNTIME_PREFIX "lib:"
                                        UCLIBC_RUNTIME_PREFIX "usr/lib"
#ifndef __LDSO_CACHE_SUPPORT__
                                        ":" UCLIBC_RUNTIME_PREFIX 
"usr/X11R6/lib"
#endif
                                        , rpnt);

If you build with UCLIB_RUNTIME_PREFIX="/" or similar (as I tend to)...

> Hardlink the existing shared libraries into the alternate position, then
> hack every existing installed executable in this way.

Don't forget that pretty much every other shared library (zlib, ncurses, 
openssl, etc) also links against libc, so you have to move those to the 
alternate position and rebuild them too.

So every binary and every shared library in the entire filesystem essentially 
get moved to the new position.

This is usually called a "chroot".

> I intend to do something like this for my 0.9.30.3 to 0.9.31 rollover,
> but I haven't finished writing the necessary utilities yet.

I look foward to hearing about the result.

Rob
-- 
Latency is more important than throughput. It's that simple. - Linus Torvalds


More information about the uClibc mailing list