Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!rutgers!njin!princeton!phoenix!caromero From: caromero@phoenix.Princeton.EDU (C. Antonio Romero) Newsgroups: comp.sys.ibm.pc Subject: Re: Turbo C links in everything in obj's Message-ID: <7337@phoenix.Princeton.EDU> Date: 23 Mar 89 19:22:25 GMT References: <1065@ptolemy.arc.nasa.gov> Reply-To: caromero@phoenix.Princeton.EDU (C. Antonio Romero) Organization: Princeton University, NJ Lines: 23 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. >For instance, if you have a file with the following fn's in it > main, a, b, c, d, e >and main does not call any of a, b, c, d, or e, the linker still >includes the objects for a, b, c, d, and e. 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... 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.) -Antonio Romero romero@confidence.princeton.edu