Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!metro!cluster!swift!suite.sw.oz.au!peterc From: peterc@suite.sw.oz.au.sw.oz.au (Peter Chubb,-x27,6982322,3982735) Newsgroups: comp.os.minix Subject: Re: Shared libraries with minix Message-ID: <1991Jun5.001444.13267@softway.sw.oz.au> Date: 5 Jun 91 00:14:44 GMT References: <1991Jun4.041033.20792@dvorak.amd.com> Sender: news@softway.sw.oz.au (Usenet) Organization: Softway Pty Ltd Lines: 29 Originator: peterc@suite.sw.oz.au From article <1991Jun4.041033.20792@dvorak.amd.com>, by tim@proton.amd.com (Tim Olson): > > Another (albeit grungy!) possibility for non-PIC systems is to fix the > library's virtual addresses to well-known, otherwise unused virtual > memory locations, and compile the library to use those addresses (e.g. > printf() exists at 0xa0001234 in every process' address space). Then, > the one physical copy of the library gets mapped to the same virtual > address in each process at runtime. However, this type of > shared-library mapping quickly becomes impossible to use when frequent > changes to the libraries occur. Alternatively, have a vector of addresses of routines at some standard place in the system -- rather like the way AmigaDOS does things now. It goes (almost) without saying that the shared library code itself has to be written to be reentrant. The data area used has to be that appropriate for the process calling the function. In a MMU-based system that's easy: data virtual addresses can start at zero (separate i/d); in a non-MMU based system, the calling convention will have to include setting a pointer to the base of the process's data segment. All data references by the library routine will then have to be indirected off this pointer, preferably automatically by the compiler. Regards, - Peter Chubb Softway Pty Ltd, P.O. Box 305, Strawberry Hills, NSW 2012, AUSTRALIA Phone: +61 2 698 2322; Fax: +61 2 699 9174; Telex: AA27987 Internet: peterc@softway.oz.au UUCP: ...!uunet!softway.oz!peterc