Dynamic and Static Linking

David Johnson david at usermode.org
Mon Apr 3 03:46:59 UTC 2000


On Sun, 02 Apr 2000, W. Yip wrote:

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

Programmatically, linking is the use of functions and routines resident
in libraries, those ubiquitous *.so files. Instead of rewriting the
basic i/o routines that every program needs, they typically use those
already available in the libraries. Examples include readline, which as
routines to read and process input from the command line, and Qt, which
has routines to implement various graphical widgets.

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

When a program statically links to a library, the actual routines of
the library are incorporated into the program. With dynamic linking,
only references to the routines are included. The advantage to static
linking is that the user doesn't have to hunt down libraries that the
program needs, they are already included. The advantage of dynamic
linking is that user memory is saved by not having redundant code.

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

I don't know about BeOS.

The LGPL specifically allows static and dynamic linking with no
restrictions. However, the GPL is pretty much silent on the matter.

There have arisen two predominant views of linking with regards to the
GPL. Both sides agree that the GPL places restrictions on applications
that statically links to GPL code. This is because actual GPL binary
code is distributed with the application.

One side sees dynamic linking as being similarly restricted. Arguments
cover the inclusion of header files whether or not the linking is
static or dynamic. Another is that any code that links to any other
code is automatically derivative. Finally, there is the argument that
the source to all "modules" has to be included with the distribution,
and anything that is linked to is a module.

The other side disagrees. They say that dynamic linking only uses
references and not actual code. Also, the derivation that results from
linking is programmatical, and has nothing at all to do with copyright.
Finally, they point to the fact that dynamic linking neither copies,
modifies or distributes any of the libraries code.

It is my opinion that neither side with reconcile with the other. It is
one reason why Debian doesn't distribute KDE. 

-- 
David Johnson...
_____________________________
http://www.usermode.org



More information about the License-discuss mailing list