Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!cuae2!ltuxa!we53!sw013b!dj3b1!killer!jfh From: jfh@killer.UUCP Newsgroups: comp.lang.c Subject: Re: Shared run-time libraries Message-ID: <737@killer.UUCP> Date: Fri, 3-Apr-87 15:33:47 EST Article-I.D.: killer.737 Posted: Fri Apr 3 15:33:47 1987 Date-Received: Sun, 5-Apr-87 12:44:12 EST References: <6644@brl-adm.ARPA> Organization: The Unix(tm) Connection, Dallas, Texas Lines: 25 Summary: How we did it... While at Pinnacle Systems in Dallas America, John Bremsteller and I played with the idea of shared libraries. The method we used was quite simple. (simple methods for simple minds :-) We created a shared memory segment into which we copied a file containing an array of pointers to the routines and the routines themselves. The offsets into the array were predefined. The file was created by relocating the base of the text segment to some address and linking all of the parts together. We then wrote a program that would extract the text segment of this a.out file. The text was copied into the shared memory segment. Then, we wrote stub routines in /lib/libc.a that called these routines. When you linked with these routines, you got a stub with an indirect call to a procedure in the library. The only problem was that you had to attach to the shared memory segment yourself. And you couldn't do much until you did. The big advantage of this was that it was very simple to implement and could probably be implemented on any system that has shared memory without having to make any modifications to the kernel. - john. (jfh@killer.UUCP) No disclaimer. Whatcha gonna do, sue me?