Xref: utzoo comp.software-eng:2651 comp.misc:7628 Path: utzoo!attcan!uunet!wuarchive!usc!ucsd!ucbvax!unisoft!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.software-eng,comp.misc Subject: Re: Linkers Message-ID: <9232@hoptoad.uucp> Date: 9 Dec 89 05:23:01 GMT References: <9185@hoptoad.uucp> <530@enea.se> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 33 In article <530@enea.se> sommar@enea.se (Erland Sommarskog) writes: >Tim Maroney (tim@hoptoad.UUCP) writes: >>WHAT? What year is this? I don't think I've ever used a linker that >>didn't eliminate unused routines. Any such linker would be seriously >>brain damaged. > >While this may seem credible at first glance, it is at not second. Try the third.... >I am very happy that the linker we use in our project (VMS LINK) >don't remove uncalled routines. In that case it would notice that >this routine is never called, and never is this one and so forth and >rapidly it would have removed the 250 top modules. > >The trick is in Cobol where you can say > Routine PIC x(32). > ... > CALL Routine USING.... >Routine is not a literal, it is a string variable. All top entries >corresponds to menu choices. When the user enters a menu choice, >it is looked up in a database, which gives you the name of the >procedure to call. And of course, all such routines are referenced; pointers to them are stored in this database. The analogue in C is when a routine is never explicitly called, but a function pointer to it is used in a referenced routine. The routine is referenced, just as routines entered into a late-binding database are referenced. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "This signature is not to be quoted." -- Erland Sommarskog