Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site chemabs Path: utzoo!watmath!clyde!cbosgd!apr!chemabs!garyd From: garyd@chemabs (garyd) Newsgroups: net.wanted,net.unix-wizards Subject: Shared Code under UNIX System V Message-ID: <140@chemabs> Date: Fri, 14-Dec-84 14:07:36 EST Article-I.D.: chemabs.140 Posted: Fri Dec 14 14:07:36 1984 Date-Received: Sat, 15-Dec-84 03:09:55 EST Organization: Chem Abs Serv, Columbus OH Lines: 28 Xref: watmath net.wanted:5360 net.unix-wizards:11057 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