Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tdatirv!sarima From: sarima@tdatirv.UUCP (Stanley Friesen) Newsgroups: comp.lang.c++ Subject: Re: Let's write a new linker! (Was: Re: Naming Conventions) Keywords: name mangling linking symbol clashes Message-ID: <135@tdatirv.UUCP> Date: 9 Feb 91 16:47:16 GMT References: <1604@tcs.tcs.com> <474@mole-end.UUCP> <3782@lupine.NCD.COM> Reply-To: sarima@tdatirv.UUCP (Stanley Friesen) Organization: Teradata Corp., Irvine Lines: 24 In article <3782@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: |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. | |By the time the "name" strings get down into the object files, it no longer |really matters whether or not they contain "special" characters (or even |blanks). By that time, the only tools that will be doing anything with the |"name" strings are the linker and possibly some object-file-dump program. |Those programs probably don't give a damn what characters appear the |strings in the linker symbol table. This sounds very nice, however, these tools *do* sometimes care what characters appear in the name strings. In particular, the way debugging information is maintained for sdb and dbx under UNIX is to append a type descriptor string to the end of the each symbol name. This means that even the linker must care about the contents of the name string, since it must link only on the 'real' part of the name, not the type extension. These type extensions are introduced by a ':', which makes the natural C++ name for a member function unusable. -- --------------- uunet!tdatirv!sarima (Stanley Friesen)