From owner-freebsd-questions Wed Nov 26 15:51:16 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA00923 for questions-outgoing; Wed, 26 Nov 1997 15:51:16 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA00915 for ; Wed, 26 Nov 1997 15:51:11 -0800 (PST) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.7) with SMTP id PAA19527; Wed, 26 Nov 1997 15:51:07 -0800 (PST) (envelope-from dwhite@gdi.uoregon.edu) Date: Wed, 26 Nov 1997 15:51:07 -0800 (PST) From: Doug White Reply-To: Doug White To: Greg Pavelcak cc: freebsd-questions@FreeBSD.ORG Subject: Re: Linked Libraries In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, 31 Oct 1997, Greg Pavelcak wrote: > I don't know if there's a short answer to this, but I have seen > "statically" and "dynamically" linked libraries mentioned. Recently in > reading the Makefile for cvsup I noticed I can choose to statically > link the modula-3 libraries. What does all this mean? What are the > advantages to choosing one over the other? Actually, it's statically and dynamically linked executables. In the normal universe, a program references libraries that are stored separately on disk. When a program needs a routine from the library, ld checks to see if the library is already in memory. If it isn't, then the library is loaded in. If anything else references the same library, it uses the single loaded copy. This is called `shared libraries'. It saves a lot of memory and disk activity. However there may be cases where you can't distribute a library, for licensing or simplicity reasons. Statically linking builds all the libraries it needs into the executable itself, increasing it's size. This is nice since you don't need to install the libs but a pain since it grows the executable size phoenominally. Great for distributing Motif binaries. Hope that helps somewhat. Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major