From owner-freebsd-security Thu Jun 27 0:16:19 2002 Delivered-To: freebsd-security@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id C8EF737B40B for ; Thu, 27 Jun 2002 00:15:58 -0700 (PDT) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.3/8.12.3) with ESMTP id g5R7Fql1065616; Thu, 27 Jun 2002 00:15:52 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.3/8.12.3/Submit) id g5R7Fqv9065615; Thu, 27 Jun 2002 00:15:52 -0700 (PDT) (envelope-from dillon) Date: Thu, 27 Jun 2002 00:15:52 -0700 (PDT) From: Matthew Dillon Message-Id: <200206270715.g5R7Fqv9065615@apollo.backplane.com> To: Klaus Steden Cc: Roger Marquis , security@FreeBSD.ORG Subject: Re: Legacy Static Linking (was: Security Advisory FreeBSD-SA-02:28.resolv) References: <20020626183519.F36946-100000@roble.com> <20020627012510.X589@cthulu.compt.com> Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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 :> :> 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