Shared libraries

Barry Margolin barmar at think.com
Thu Apr 25 09:10:48 AEST 1991


In article <718 at seqp4.UUCP> jdarcy at seqp4.ORG (Jeff d'Arcy) writes:
>  Do you really think so many skilled and knowledgeable
>OS developers would implement shared libraries if they weren't worth it?

What I want to know is why it has taken so long for them to rediscover
shared libraries.  Multics, the predecessor to Unix, was using
dynamically-linked, shared libraries in the 60's.

Furthermore, the SunOS dynamic linking design is still inferior to the
Multics design (I don't know details of other Unix dynamic linking
designs).  Libraries should be linked on demand, not all at the beginning
of the program.  This way, infrequently-used routines do not have any
overhead except when they're used.  However, this should be coupled with
better OS support for dynamic link failures (it would be a shame for the
process to core dump just because LD_LIBRARY_PATH is missing a necessary
directory).  Also, on-demand linking is harder to implement for data than
for code, often requiring hardware support (Multics does all dynamic
linking by indirecting through pointers with a special trap bit set -- the
trap handler resolves the link, rewrites the pointer, and restarts the
interrupted instruction, so procedures and data are equivalent).

--
Barry Margolin, Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.unix.internals mailing list