Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!amdahl!pacbell!sactoh0!bkbarret From: bkbarret@sactoh0.UUCP (Brent K. Barrett) Newsgroups: comp.sys.ibm.pc Subject: Re: Turbo C links in everything in obj's Message-ID: <775@sactoh0.UUCP> Date: 24 Mar 89 19:55:45 GMT References: <1065@ptolemy.arc.nasa.gov> <7337@phoenix.Princeton.EDU> Organization: Sacramento Public Access, Ca. USA Lines: 34 In article <7337@phoenix.Princeton.EDU>, caromero@phoenix.Princeton.EDU (C. Antonio Romero) writes: > In article <1065@ptolemy.arc.nasa.gov> raymond@ptolemy.arc.nasa.gov > (Eric A. Raymond) writes: > >It appears that the linker in Turbo C (2.0) links in everything you > >have in your .objs independent of whether the code is actually used. > [stuff from Eric deleted as well as stuff from Antonio] > One difficulty with not doing so is that one might access something > through a function pointer, which would be pretty tough to detect > for the linker. I do see what you mean, though... > Well, that one can be cured by declaring the function the hard way: int myFunc(); would force the function to be linked even if not apparently used. > If this is a big problem for your application, why not turn a,b,c,d,and > e into a library and link with that? (Don't ask me how to do this with > Turbo C, I don't develop software for PCs anymore. But I'm sure it's > possible, somehow... there must be some sort of library manager for > Turbo.) > Yup. Sure does. TLIB is a very nice librarian. I think it's a good idea to make it an option, but might I propose some speculation as to why Borland did it? Speed. They're famous for it, and it takes overhead to check for function usage. Again, I agree that such an option *would* be handy, and I'd like to see it too. -- Brent Barrett ..pacbell!sactoh0!bkbarret GEMAIL: B.K.BARRETT