advice needed regarding c++ name mangling

Mark Mitchell mark@codesourcery.com
Sun Mar 13 18:40:00 GMT 2005


Razya Ladelsky wrote:
> Mark Mitchell <mark@codesourcery.com> wrote on 11/03/2005 04:55:38:
> 
> 
>>Daniel Berlin wrote:
>>
>>
>>>As for why the new name doesn't work, it's not clear from the above.
>>>I'd need to see the assembly and the error.
>>>:)
>>
>>Likewise.  I assume these functions have only internal linkage?  Or that 
> 
> 
>>the original function is still provided with external linkage?  (I'm 
>>just checking that we're not breaking the ABI.)
>>
> 
> 
> These functions indeed have only internal linkage.
> The error I get is :
> 
> /tmp/cc9VryOe.s: Assembler messages:
> /tmp/cc9VryOe.s:11056: Error: unrecognized symbol type ""
> /tmp/cc9VryOe.s:11056: Warning: rest of line ignored; first ignored 
> character is `<'

I'm not sure how exactly you're doing things.  But what you should be 
doing, I think, is annotating declarations with a "version" field, and 
then having the code in cp/mangle.c mangle that into the unqualified 
name of the function.  That will also allow the demangler to work OK.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc mailing list