Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: Let's write a new linker! (Was: Re: Naming Conventions) Summary: Why not postprocess? Keywords: name mangling linking symbol clashes Message-ID: <482@mole-end.UUCP> Date: 14 Feb 91 04:26:38 GMT References: <1604@tcs.tcs.com> <3782@lupine.NCD.COM> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 35 > In article <474@mole-end.UUCP> mat@mole-end.UUCP (Mark A Terribile) writes: > +> What, with name mangling and symbol clashes, what we really need is a > +> new linker. ... > +I'm inclined to agree that we need better linkers, but I don't know how we > +can get them. It's hard to force linkers on operating systems, ... > In fact, what is needed is *not* new linkers but rather new assemblers > and C compilers. > Name mangling is used in the cfront translator because it generates C and > because there are no C compilers which accept "void func (int, int)" as > an identifier. Likewise, g++ (which generates assembly code directly) > must use name mangling because no existing assembler accepts the string > "void func (int, int)" as an identifier. Ron, you are absolutely right. It's enough to have a way to get the symbols into the object file (assuming that there aren't peculiar bugs in the linker's algorithms that will cause it to address Never-Never Land when punctuation is seen). Why not post-process the object files either before or after linking? (I think I did hint at this somewhere recently.) But again, you couldn't do this on the HP3000 under MPE; the assembler too is a trusted program. Depending on the organization of the linker's symbol table (hash, B-tree, whatever) teaching the linker about name spaces belonging to classes or modules might improve performance somewhat, especially if it improves cache or paging performance. There's really no excuse for g++, though; GNU writes its own assembler, as I recall. -- (This man's opinions are his own.) From mole-end Mark Terribile