Xref: utzoo comp.lang.c:17257 comp.sys.ibm.pc:26735 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!portal!cup.portal.com!Devin_E_Ben-Hur From: Devin_E_Ben-Hur@cup.portal.com Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: Question about linking files Message-ID: <16356@cup.portal.com> Date: 28 Mar 89 23:13:42 GMT References: <18925@iuvax.cs.indiana.edu> <16541@mimsy.UUCP> <16546@mimsy.UUCP> <10126@bloom-beacon.MIT.EDU> <16315@cup.portal.com> Distribution: na Organization: The Portal System (TM) Lines: 36 > I think that this discussion of external linkages has missed the point of > the original poster, although I could be missing the point too. > > If I read the original correctly, he is saying that given: > > MY.LIB <== A.OBJ entry points A1 A2 A3 externals C1 > B.OBJ entry points B1 B2 B3 > C.OBJ entry points C1 C2 C3 > Nope, the original poster made no mention of libraries. He wished the linker to treat: LINK A+B+C,P.EXE; as if all the functions in A,B,&C were independantly compiled then made into a library and linked only if referenced. > and given > > main () { a1(); a3(); } > > then the Turbo C linker will include ALL 3 modules in the resulting > executable, whereas it is plain that B.OBJ is not required. If this > is, in fact, the case, then the Turbo C linker is _broken_. The Microsoft > Linker will include only A.OBJ and C.OBJ in the executable. > The turbo linker will perform just link the uSoft linker for this. Even if it did include B.OBJ, it would not be _broken_ merely an inferior implementation. A broken linker produces an incorect program, including b.obj does not make the output incorrect, merely larger than neccessary. > Now, if A, B, and C are all modules on a single OBJ, and that OBJ is fed > to the linker, then one would expect all three to appear on the executable. > I don't think that was the question, however. > > Tim_CDC_Roberts@cup.portal.com | Control Data... > ...!sun!portal!cup.portal.com!tim_cdc_roberts | ...or it will control you. Devin_Ben-Hur@Cup.Portal.Com ...ucbvax!sun!portal!cup.portal.com!devin_ben-hur