Tweaks page updated

Adam Trilling agt10 at
Sun Jul 28 22:13:34 PDT 2002

On Sun, 28 Jul 2002, Charles Lacour wrote:

> In the interests of writing such a script, how do you tell a static
> library from a dynamic one?
> For that matter, what exactly _is_ a static library? I understand static
> programs (which don't use libraries) and dynamic programs (which do), but
> static vs dynamic for the libraries themselves doesn't entirely make sense.
> (I realize this is a bit off-topic, so if you want, send the answer to
> either lfsdev at or clacour at I suspect there's more
> than a few lurkers that could use the answer also, though.)

How to tell the difference:  static library filenames end in .a or .la.
Dynamic library filenames end in .so (which is a symlink to, which is a symlink to

The real difference:  when a program links against a static library, the
code of the library is actually copied into the executable.  When a
program links against a dynamic library, the library is loaded into memory
when the program runs.  Therefore many programs can use the same copy of a
library.  With something like glibc, where almost every program on your
system links against it, this saves a tremendous amount of space.

The added cost is complexity.  But it's a complexity you don't see much
unless you hack gcc or glibc or the kernel.

For further reading, check out the Program Library HOWTO on tldp.
Interesting reading, and very informative.

Adam Trilling
agt10 at

char m[9999],*n[99],*r=m,*p=m+5000,**s=n,d,c;main(){for(read(0,r,4000);c=*r;

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list