Shared system routines

Guy Harris guy at rlgvax.UUCP
Thu Jul 28 05:54:41 AEST 1983


The way Multics solved the "global references from shared libraries" problem
was to use a giant transfer vector called the "(common) linkage segment".
This was also necessary for the dynamic linking.  Any reference to an external
of any sort went through an indirect pointer in the common linkage segment.
This pointer was initially a special pointer which caused a trap, and it
pointed to a character string which was the name of the external.  When the
fault occured due to this pointer, the OS would find the segment referenced
by that pointer (using a search rule similar to PATH) and "initiate" it (i.e.,
map it into your address space).  It would copy the prototype of its common
linkage segment section into the system common linkage segment (which was also
the per-process static data segment, so this copy would also initialize static
variables), so any time any routine in that segment referenced an external the
same fault process would occur.  Then it would paste the address of the
given entry point in the given segment into the pointer in the common linkage
segment.  Unfortunately for this scheme under UNIX, existing compilers don't
produce code to reference externals through such a transfer vector (at least
not on the machines I'm familiar with; I've seen references to transfer vectors
on the 3B machines), so the Multics solution can't just be dropped into UNIX.

	Guy Harris
	{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list