Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!cbmvax!daveh From: daveh@cbmvax.UUCP (Dave Haynie) Newsgroups: comp.arch,comp.unix.wizards,comp.os.misc Subject: Re: Shared libraries (Was: Re: Big Programs Hurt Performance) Message-ID: <2386@cbmvax.UUCP> Date: Thu, 24-Sep-87 12:37:26 EDT Article-I.D.: cbmvax.2386 Posted: Thu Sep 24 12:37:26 1987 Date-Received: Sat, 26-Sep-87 17:09:32 EDT References: <28957@sun.uucp> Organization: Commodore Technology, West Chester, PA Lines: 54 Xref: mnetor comp.arch:2330 comp.unix.wizards:4455 comp.os.misc:229 in article <28957@sun.uucp>, guy%gorodish@Sun.COM (Guy Harris) says: > Xref: cbmvax comp.arch:2266 comp.unix.wizards:4354 comp.os.misc:224 > >> >It's not too uncommon that a new version of a program comes along, but some >> >people still want to use the old version, for whatever reason. >> >> You have to relink with the unshared version of the old library. > > You do in some, but not all, implementations. An earlier article indicated > that the Amiga implementation permits you to specify a version number when the > library is opened (does this mean programs have to explicitly open shared > libraries, i.e., they have to know that they're using a shared library?). Well, somewhere in each executable you'll find an explicit request to open and subsequently close any shared libraries. The is very important for Amiga with small amounts of memory, since it allows the OS to load on demand any disk-based libraries, and to dump any that are no longer used. Currenly all Amiga system functions are available only as shared libraries, and the programmer normally includes a single OS call to open each, followed by one to close each. Of course, if unshared libraries were available, a linker could link in NOP open/close requests and maybe as much as 300K-400K of library code into your executable. Now, when you're compiling in C using UNIX compatibility calls or some such, there's UNIX style start-up code that opens everything you'd need, so in that case the programmer has probably no idea what's shared and what isn't. > See "Shared Libraries in SunOS" from the last USENIX proceedings for another > scheme for handling this problem. The scheme described therein permits > multiple versions of the library to be resident; when the interface changes in > a way that is expected to break old programs, the major version number is > increased, so that programs depending on an earlier major version of the > library won't bind to a later version. As far as I know no one's done this kind of thing on the Amiga yet, but I think a small modification to the OpenLibrary() function could allow for multiple generations to be kept around, if necessary. I think what's done now is that if a function is changed enough to cause most things to break, it would appear as a new function, while the old one is kept in place for backward compatibility. > Of course, this requires you to keep old versions of the library around, but > you can't have everything; if this causes a disk-space problem, you might have > to link with an unshared version of the library. Or old functions around in new libraries. > Guy Harris > {ihnp4, decvax, seismo, decwrl, ...}!sun!guy > guy@sun.com -- Dave Haynie Commodore-Amiga Usenet: {ihnp4|caip|rutgers}!cbmvax!daveh "The A2000 Guy" PLINK : D-DAVE H BIX : hazy "God, I wish I was sailing again" -Jimmy Buffett