From: | Dave Lloyd <Dave@occl-cam.demon.co.uk> |
Newsgroups: | comp.compilers |
Date: | 7 Feb 1997 23:41:45 -0500 |
Organization: | Compilers Central |
References: | 97-01-183 97-01-189 97-01-212 |
Keywords: | linker, design |
"Thomas M. Maslen" <maslen@best.com> asked
> > [I have long maintained that nested link-time scopes are a good
> > idea, but I've never seen a linker that actually provides them. -John]
>
> ... and perhaps he could expand (or expound) on that? Offhand, I'd
> file it under "nice, but overkill".
John replied:
! [It means what it sounds like, groups of modules which share symbols
! but export limited numbers of symbols to the outside. For small
! programs, it's overkill, but for large programs with lots of libraries
! and subsystems, it'd be nice not to have to prefix every symbol shared
! among routines in the foo subsystem with "foo_". Re Solaris, I looked
! at the ld man page on a nearby 4.1.4 system and it looked like the
! same old dumb linker, just barely smart enough to create and
! defererence shared libraries. Is there something else I should look
! at? -John]
The real problem is that C doesn't need it and has no ability to
express this layer of scope. With languages like Algol 68, Fortran 90,
Ada, etc., etc., with real modules, nested scopes are very
desirable. We end up mapping all our symbols to <module>$<id> to
squeeze through these crappy linkers. Name mangling in C++ is another
example of the limitations in most linkers (what is wanted is a
strong-typed linker). Many compilation systems for these bigger
languages end up using an intermediate linker or compositor to do the
semantic side of the job and then throw some objects to the system
linker for binding with the system API or stuff from other languages.
But while C/Unix rules the roost I can see little chance for change.
Regards,
----------------------------------------------------------------------
Dave Lloyd mailto:Dave@occl-cam.demon.co.uk
Oxford and Cambridge Compilers Ltd http://www.occl-cam.demon.co.uk/
Cambridge, England http://www.chaos.org.uk/~dave/
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.