Shared Code under UNIX System V

garyd garyd at chemabs
Sat Dec 15 05:07:36 AEST 1984


Does anyone have any information on techniques of sharing code between
processes in UNIX System V? I am aware of the work done by Bunker Ramo
in "shared libraries" but I am looking for other sources of design
ideas or implementations. Shared code involves allocating a chunk of
shared memory and filling it up with executable code (which probably
needs to be relocated). This region can then be attached by one or
more processes which will then be able to call the functions within it.
This results in a savings of physical memory, important when there are many
processes that need to use the code and the code is large. (The intended
code will be network interface code)

I tried an experiment (under UNIX System III) which involved allocating a 
chunk of memory (malloc), and then, using the address returned, executed the 
loader (ld) using an undocumented flag (-B addr) to relocate the module 
(previously built using ld -r).  The resulting a.out was copied to the region 
and called at addr+32 (skip over the header).  This worked but there will be 
other problems when shared memory is involved (like the bss segment).  

If you know of any sources of information or if you have any thoughts on
this capability, please reply.  Thank you!

Gary A. Davis
Chemical Abstracts Service
UUCP:  ..{ihnp4|mhuxl|ho95b|ulysses}!cbosgd!osu-eddie!apr!chemabs!garyd
AT&T:  (614) 421-3600 X2355
USPS:  Chemical Abstracts Service
       P.O. Box 3012
       Columbus, Ohio 43210



More information about the Comp.unix.wizards mailing list