Re: Smart linking under UNIX

dalamb@umiacs.umd.edu (David Lamb)
23 Aug 91 14:40:46 GMT

          From comp.compilers

Related articles
[4 earlier articles]
Re: Smart linking under UNIX jones@pyrite.cs.uiowa.edu (1991-08-21)
Re: Smart linking under UNIX rro@debussy.cs.colostate.edu (1991-08-22)
Re: Smart linking under UNIX hyatt@cis.uab.edu (1991-08-22)
Re: Smart linking under UNIX henrik@tazdevil.llnl.gov (1991-08-22)
Re: Smart linking under UNIX henrik@tazdevil.llnl.gov (1991-08-22)
Re: Smart linking under UNIX weitek!ars@Sun.COM (1991-08-22)
Re: Smart linking under UNIX dalamb@umiacs.umd.edu (1991-08-23)
Re: Smart linking under UNIX pardo@gar.cs.washington.edu (1991-08-23)
Re: Smart linking under UNIX thorinn@diku.dk (1991-08-25)
Re: Smart linking under UNIX przemek@rrdstrad.nist.gov (1991-08-26)
Re: Smart linking under UNIX davidsen@crdos1.crd.ge.com (1991-08-26)
Re: Smart linking under UNIX liam@dcs.qmw.ac.uk (William Roberts) (1991-08-27)
Re: Smart linking under UNIX mjs@hpfcso.fc.hp.com (Marc Sabatella) (1991-08-27)
| List of all articles for this month |

Newsgroups: comp.arch,comp.compilers
From: dalamb@umiacs.umd.edu (David Lamb)
Keywords: linker
Organization: UMIACS, Univ. of Maryland, College Park, MD 20742
References: <1991Aug15.205912.6553@sono.uucp> <GLEW.91Aug16145002@pdx007.intel.com> 91-08-085 91-08-114 91-08-126
Date: 23 Aug 91 14:40:46 GMT

In article 91-08-126 weitek!ars@Sun.COM (Allen Samuels) writes:
>... what I have usually seen is that the "simple" library routine calls some
>other library routine (frequently to construct an error message) that calls
>another library routine, ... Eventually you find a call to the formatted I/O
library which is invariably HUGE.


My memory is now fading, but I believe the following is essentially correct.
On the PQCC project we (mostly Joe Newcomer) invented a "msgscan" procedure,
much like [...]printf in its user interface, that didn't have to suffer from
"library bloat". The main idea was that, instead of the code for %f directly
calling the floating point procedures, it'd indirect through a table of
procedures indexed by format code (all with a standard calling sequence). By
controlling the creation of the table you could control which routines got
loaded. To play it real safe, you could include the whole world of
formatting, but you didn't have to. Empty table entries were initialized to
point to a generic "missing format code" procedure. We mostly did this to be
able to dynamically add user-defined format codes.


It's interesting how many problems can be solved by adding a level of
indirection.


With a smarter linker, I suppose the near-equivalent might be some facility of
mapping references to a particular external name to a different name (the
generic one), though that's less dynamic than Joe's scheme. With all the
interest in module interconnection languages over the last 15 years, I'm
surprised I haven't seen more people do this.


[Some years ago, I saw a Fortran compiler that looked at all of the format
statements in a routine and emitted dummy external references to force in the
runtime code corresponding to the format types actually used. My memory
fades too, but I think that it was the old F4/F40 compiler for the PDP-6 and
PDP-10. By the way, the insides of F4 were extremely similar to IBM's
Fortran G for OS/360. I always wondered who wrote it. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.