Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!cbmvax!higgin From: higgin@cbmvax.cbm.UUCP (Paul Higginbottom SALES) Newsgroups: comp.sys.amiga Subject: Re: A shared library (mostly) in C Message-ID: <1991@cbmvax.cbmvax.cbm.UUCP> Date: Tue, 9-Jun-87 10:41:52 EDT Article-I.D.: cbmvax.1991 Posted: Tue Jun 9 10:41:52 1987 Date-Received: Fri, 12-Jun-87 04:19:59 EDT References: <10113@decwrl.DEC.COM> <1358@ulowell.cs.ulowell.edu> Reply-To: higgin@cbmvax.UUCP (Paul Higginbottom SALES) Organization: Commodore Technology, West Chester, PA Lines: 28 In article <1358@ulowell.cs.ulowell.edu> page@ulowell.cs.ulowell.edu (Bob Page) writes: $Now that we can write our own C libraries, how do we handle name conflicts? $If I have (say) an "iff.library" that has an IFF read routine called $"iffread" and you have a library for your application called "myapp.library" $that also has a routine called "iffread", which one gets used, mine or yours, $assuming you call OpenLibrary() on both libraries? In order to call library functions as if they were part of your program, there is generally a "stub" routine which sets up registers etc., and then does a jump to a location offset from the library base pointer. These stubs are contained in the object code library which you link to. Therefore, there are stubs for all the intuition, dos, exec, etc. calls. So in order to have an easily usable library, you also need a linkable object stub library. Generally, a linker will resolve a reference with the first instance of that name it comes across, and give a warning on any others (as duplicate symbols, but should not STOP linking - at least this is how Manx works). The name conflict even occurs without user-created libraries. Have you ever wanted to call a routine "Write" for example, but realized that's a bad idea because it conflicts with the DOS routine. Not to say it can't be done, it's just not wise. $Bob Page, U of Lowell CS Dept. page@ulowell.{uucp,edu,csnet} Paul Higginbottom, Commodore.