What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream



 DEVELOP > c-Plus-Plus > What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "toduro"
Date: 17 Oct 2006 06:19:43 PM
Object: What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream
Sorry about the bad subject line earlier.
What is the right syntax for a C++ declaration which would give me
__ls__7ostreamPFR7ostream_R7ostream
in an object file produced by the gcc 2.95 compiler?
The name "magically" [that means I have no clue about why or how]
appeared as an undefined reference in an object file whosse
corresponding C++ source has no references at all to ostream after I
made some coding changes to improve performance and then recompiled.
I did a bit of googling and experimentation to find that:
ostream::operator <<(ostream &())
yields
__ls__7ostreamPFv_R7ostream
but I haven't seenhow to get rid of the "v_" in the middle or to get
the "_R7ostream" on the end of the mangled name. What declaaration
will work?
The rules I found from googling say that class names are prepended by
the length of the name, so "7ostream" comes from "ostream", and that
"P" stands for a pointer, "F" stands for a function, and "R" stands for
a reference.
.

User: "red floyd"

Title: Re: What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream 17 Oct 2006 07:02:10 PM
toduro wrote:

Sorry about the bad subject line earlier.

What is the right syntax for a C++ declaration which would give me

__ls__7ostreamPFR7ostream_R7ostream

in an object file produced by the gcc 2.95 compiler?

Try gnu.g++.help
Name mangling is compiler specific.
.

User: "Clark S. Cox III"

Title: Re: What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream 17 Oct 2006 07:03:54 PM
toduro wrote:

Sorry about the bad subject line earlier.

What is the right syntax for a C++ declaration which would give me

__ls__7ostreamPFR7ostream_R7ostream

in an object file produced by the gcc 2.95 compiler?

The name "magically" [that means I have no clue about why or how]
appeared as an undefined reference in an object file whosse
corresponding C++ source has no references at all to ostream after I
made some coding changes to improve performance and then recompiled.

I did a bit of googling and experimentation to find that:

ostream::operator <<(ostream &())

yields

__ls__7ostreamPFv_R7ostream

but I haven't seenhow to get rid of the "v_" in the middle or to get
the "_R7ostream" on the end of the mangled name. What declaaration
will work?

The rules I found from googling say that class names are prepended by
the length of the name, so "7ostream" comes from "ostream", and that
"P" stands for a pointer, "F" stands for a function, and "R" stands for
a reference.

This is really off topic here, as the standard doesn't mandate a
particular name mangling implementation (or if there is even any name
mangling).
Ask on a gcc group.
[OT]
The c++filt tool will tell you what you want:
[ccox-macbook:~] ccox% c++filt __ls__7ostreamPFR7ostream_R7ostream
ostream::operator<<(ostream &(*)(ostream &))
[/OT]
--
Clark S. Cox III
clarkcox3@gmail.com
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER