Dynamic and Static Linking

Ian Lance Taylor ian at airs.com
Sun Apr 2 21:27:55 UTC 2000


   From: W.Yip <weng at yours.com>
   Date: Sun, 02 Apr 2000 22:11:15 +0100

   1) What is dynamic linking? Is it the 'ln' command in Linux for symbolic
   linking?

It has nothing to do with the `ln' command.

Linking in this sense is the process of combining object files and
libraries into an executable.  It is done by the `ld' command, which
is typically invoked by the compiler `cc' (or `gcc') when building a
program.  See the relevant man pages.

Dynamic linking is the use of shared libraries, also called dynamic
objects.  On a typical Unix system, shared libraries have extensions
of .so, possibly followed by a version number.  They can often be
found in /lib or /usr/lib.  Windows also uses shared libraries; they
are called DLLs (Dynamic Link Libraries).

A single shared library can be used (in fact, shared) among many
different programs.  A shared library can be changed without relinking
the program; the program will automatically use the newer version.

   2) What is static linking? Is that a link to libraries on your hard disk?

Static linking is linking a program without using a shared library.

   3) Can you give me some examples of dynamic linking (un)covered by the GPL?
   Is BeOS a case in example?

The GPL was written before widespread use of shared libraries.  Thus,
it is not clear whether dynamic linking is covered by the GPL or not.

In a modern Unix or Windows system, the basic system libraries are
shared libraries.  Since these can be reasonably considered a part of
the operating system, it is likely that the system exception of the
GPL applies to them (paragraph 3).

The interesting cases come when somebody modifies a GPL program to use
a nonstandard shared library.  Are they required to distribute the
sources to that shared library, or is it acceptable to merely supply a
binary form of that shared library?

Shared libraries are merely one point in a continuum of GPL
considerations, which also includes using CORBA or some similar
protocol to make remote procedure calls to other code which may only
be available in binary form, or, indeed, may be run on a controlled
machine accessible over the Internet and not otherwise be available in
any form at all.


My take on these sorts of GPL issues is that there is no answer.
Because we are talking about an continuum with infinite gradations,
there is no clear way to draw the line anywhere.  Because we are
talking about a matter of law, not science or technology, the only way
to draw a line is to make an arbitrary decision.

Speaking about the U.S., I believe the legislature is unlikely to make
any such decision unless they are pushed to by large companies or
powerful special interest groups; however, I don't know of any large
companies or special interest groups who really care about GPL arcana.
Therefore, if any decision is made, it will come from the court
system, but court cases take a notoriously long time to complete and
can easily wind up being vague and difficult to apply outside of very
specific circumstances.  Moreover, by the time they decide on one
aspect of this issue, it is likely to be obsolete and irrelevant.

So, just do what you think is right, and don't worry about it.  If you
are trying to hack the GPL to make a proprietary fork of somebody
else's work, then you are behaving wrongly.  Don't do it.

Ian



More information about the License-discuss mailing list