Date: Wed, 26 Nov 1997 15:51:07 -0800 (PST) From: Doug White <dwhite@gdi.uoregon.edu> To: Greg Pavelcak <gpavelcak@philos.umass.edu> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Linked Libraries Message-ID: <Pine.BSF.3.96.971126153640.19241W-100000@gdi.uoregon.edu> In-Reply-To: <XFMail.971124113705.gpavelcak@philos.umass.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971126153640.19241W-100000>