Bugtraq mailing list archives

Re: Turning dynamic into static?


From: hartmans () MIT EDU (Sam Hartman)
Date: Fri, 10 Nov 1995 16:48:08 -0500


"Lawrence" == Lawrence R Rogers <lrr () cert org> writes:

    Lawrence> Speaking of shared object libraries and dynamic linking,
    Lawrence> is it possible to turned a dynamically linked program
    Lawrence> into a static one with ld, ld.so, whatever?

        Depends on the OS.  You can do this with non-stripped binaries
under AIX.  I don't think any OS has an ld.so that will allow this; it
will be ld or nothing in most cases.

    Lawrence> If possible, Sun could distributed /usr/bin/login as a
    Lawrence> dynamically linked program and those who wish could make
    Lawrence> it static.

        This IMHO, is bad policy, but we've already had that argument,
and I certainly think that to the extent that it doesn't make Sun's
job harder (for login, it actually does make the job much harder),
allowing static relinking would be reasonable.  Of course, if you want
ultimate flexibility, get an OS with source--some day this may be an
option for all platforms.


    Lawrence> Consider the sysadmin who needs a set of known tools
    Lawrence> that they can carry around on a floppy, tools like ps,
    Lawrence> netstat, ifconfig, etc.  Those tools would be imune to
    Lawrence> various types of corruption of a system, changes to
    Lawrence> shared object libraries for example.  Sure, one could
    Lawrence> fetch GNU tools and build them statically but the
    Lawrence> vendor's tools may be preferrable.

        It's kind of ironic that you mention changes in shared objects
as one of the things that would make static tools desirable.  My
experience with AIX and Solaris has tought me taht you want to link
dynamically if you want a binary to work over multiple versions of the
OS.  Still, for debugging, tools like ls, sh, cp, mv, ln, ps, etc that
are static is incredibly useful.  Most vendors have finally realized
this.


    Lawrence> Thanks for your thoughts.  --

    Lawrence>                                         Larry Rogers
    Lawrence> Member, Technical Staff Trustworthy Systems Software
    Lawrence> Engineering Institute Carnegie-Mellon University
    Lawrence> Pittsburgh, PA 15213 lrr () cert org lrr () sei cmu edu



Current thread: