Xref: utzoo comp.software-eng:2655 comp.misc:7638 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rutgers!mcnc!rti!sheol!throopw From: throopw@sheol.UUCP (Wayne Throop) Newsgroups: comp.software-eng,comp.misc Subject: Re: Coding standards (was Re: Programmer productivity) Summary: not so much link technology as language technology Message-ID: <0262@sheol.UUCP> Date: 8 Dec 89 20:42:03 GMT References: <34796@regenmeister.uucp> <600@fred.UUCP> <9220@hoptoad.uucp> Lines: 37 > tim@hoptoad.uucp (Tim Maroney) > The linkers I use every day on the Macintosh routinely remove all > unreferenced routines from output files. On the other hand, it turns > out that very few, if any, UNIX linkers do this. There are many different reasons for this, but it is perhaps worth noting that the problem isn't purely a linker problem. If the compiler doesn't generate object code with the separable portions marked out, the linker simply can't separate them. There are valid reasons for generating unravelable object files, having to do with just what tradeoffs one wishes to make between compile, link, and runtime efficency. The general Mac environment makes the motives for making this tradeoff differently than traditional mainframe and minicomputer language systems compelling. > but I've just read all ten pages of > the ld(1) manual page, and it never explicitly says this, so I feel > justified in the error. I think the real meat of it is in the a.out(5) (or is that (6)) man page, that is, the executable/object-file data format definition. Reading between the lines of this, it becomes apparent that it would be difficult (though not impossible) for a compiler to generate separable object files, and thus at least as difficult for a linker to separate them. (This is, of course, still not an explicit statement of functional deficit.) Question: is it possible to convince the Mac language environment to leave the unreferenced routines and data in the executable image equivalent? If not, unit testing from a good debugger becomes more difficult. (Mind you, not impossible.... one could simply artificially reference every routine you want to unit test, but this could be tedious or even problematical.) -- Wayne Throop !mcnc!rti!sheol!throopw or sheol!throopw@rti.rti.org