Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!usc!blars!blarson From: blarson@blars Newsgroups: comp.os.os9 Subject: Re: C Linker Library problems -- help! Keywords: OSK, C, linker, libraries Message-ID: <196@blars> Date: 26 Apr 91 08:21:29 GMT References: <1991Apr25.175935.8665@cbnewsd.att.com> Sender: news@usc Reply-To: blarson@usc.edu Lines: 45 Nntp-Posting-Host: dianne.usc.edu Originator: blarson@dianne.usc.edu In article <1991Apr25.175935.8665@cbnewsd.att.com> knudsen@cbnewsd.att.com (michael.j.knudsen) writes: >In theory, if function F exists in your own code and also a library, >it is ignored in the library and your own F is linked. Nice theory. Too bad it's wrong. (Most unix linkers work that way.) L68 does not allow multiple routines with the same name. Circularly refering routines, which other operating systems allow by putting the same routine in the library multiple times, must be done as a single source file on OSK. This is one of the uglier hacks still needed in C news for OSK. I'll clarify why that is irrelivent in this case: >PS: The .r file I'm using as a "lib" was not originally intended >as such -- its several functions and global arrays were not MERGEd >together, but just compiled from one source file. All routines in any one source file are always pulled in as a unit. Microware even took advantage of this on their 6809 version by having some routines printf needed only pulled in if there was a reference to another function in your code. (The other function did nothing, and did not have to be called!) >Does that confuse the Linker L68? THIS may be the real problem! Confuse, no, but it won't pull the routines apart. >(3) If F in the library calls G in the library, then by (2) you >can't replace G with your own, but you *should* be able to replace F. It would be nice. Sugest it as an enhancement to microware. >Any way to split it into a merged lib format? Dissassemble or rewrite. -- blarson@usc.edu C news and rn for os9/68k! -- Bob Larson (blars) blarson@usc.edu usc!blarson Hiding differences does not make them go away. Accepting differences makes them unimportant.