Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2002 00:15:52 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Klaus Steden <klaus@compt.com>
Cc:        Roger Marquis <marquis@roble.com>, security@FreeBSD.ORG
Subject:   Re: Legacy Static Linking (was: Security Advisory FreeBSD-SA-02:28.resolv)
Message-ID:  <200206270715.g5R7Fqv9065615@apollo.backplane.com>
References:  <20020626183519.F36946-100000@roble.com> <20020627012510.X589@cthulu.compt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
    Yes, our /bin and /sbin contain static-linked binaries.  Stuff in /usr
    typically contains dynamically linked binaries.  The reasons are:

    * So we can keep the root partition small (not have to put some of the
      dynamic link libraries in root or need a /lib).

    * Safety.  When things go wrong having critical system boot and recovery
      programs statically linked will save your bacon.  It's certainly saved
      mine!   Lots of things can go wrong, from a bad system upgrade to a
      blown filesystem to simple mistakes by developers.

    Static linking eats a little extra space but that's about it.  Statically
    linked binaries will actually start up more quickly and use less 'dirty'
    memory (due to not having to do any run-time linking) so it isn't a
    performance issue, really.  Having the small number of programs in
    /bin and /sbin statically linked makes sense, and having the much greater
    number of programs in /usr dynamically linked to save space also makes
    sense.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

:> 
:> This makes a good case for doing away with static linking of system
:> binaries.
:> 
:> Why does FreeBSD have statically linked binaries?
:> 
:I dunno, I find static binaries pretty damn useful as bootstrap and recovery
:tools on broken systems that don't necessarily run FreeBSD but whose disks I
:have to preserve.
:
:Static binaries still have a purpose, inasmuch as dynamic binaries have a
:purpose. I would be disappointed to discover static linking done away with ...
:however, a system-wide compile time option might not be a bad idea.
:
:$0.02,
:Klaus

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206270715.g5R7Fqv9065615>