Re: severe ld.so bug !!

Richard Gooch (rgooch@atnf.csiro.au)
Wed, 18 Dec 1996 21:40:00 +1100


Eric Horst writes:
>
>
> > ld.so (both 1.7.x and at least 1.8.3 using SuSE 4.4) has a SEVERE bug: if
> >
> > /etc/ld.so.cache
> >
> > is an empty file, every binary using shared libs will SEGV !
>
> which brings up something i've complained about before in other forums. a
> certain number of critical binaries need to be staticly linked. it seems
> to me (and others) that you should be able to boot a system to some very
> minimally usable state without requiring shared libs. traditionally the
> linux community does this with floppies but is can be done a better way.

You assert this but can you justify it? I assert the opposite.

> i recall working wonders with 'ln' and 'mv' on a sunos box with corrupted
> libraries. looking at a sunos 4.1.3 box i see that init=/bin/sh would
> have worked (wow! cuz /bin/sh is staticly linked as it should be). and a
> handful of useful things in /bin and /etc are static (such as mount,
> ifconfig, update, fsck, hostname, ldd, tar, sh, mv, ln). you can do lots
> with these.
>
> on my redhat system a brief look at /bin and /sbin reveals only a couple
> static bins namely "ldconfig" and the e2fs tools (which are only static
> cuz the author knows they should be). this situation should be improved.

Funny you mention that. Every time a new version of the ext2fs progs
comes available, I have to edit the Makefiles to compile/link
everything dynamically. It's a great pity that this isn't a
configuration option (yes, I know there is a similar option, but it
still leaves e2fsck static:-().

> the little bit of extra disk space used by staticly linking a few bins is
> cheap.
>
> you'll all think i'm crazy until the day it would have saved you some
> precious minutes of downtime. take action! write your local governments
> or at least the author of your favorite distribution!

Not crazy: I just don't agree. I thought about the "benefit" of a few
precious statically linked binaries, and decided it was just a
mirage. If my root filesystem gets corrupted, I have no reason to
expect that /lib/libc.so.?.?.? will get hit rather than /sbin/init or
/bin/bash
Instead I put my efforts into making a useful boot/root pair of
floppies that I can use for installation/upgrade/recovery. And of
course, floppies being capacity-impaired, you have to be very careful
about what you put on them. Hence the need for dynamic everything.
I also don't want to build one set of binaries for my "real" systems
and another for my floppies. And I want the *same* floppies for
installation/upgrade as for recovery.

Regards,

Richard....