DEVELOP > c-Plus-Plus > What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream
| 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
.
|
|
|
|

|
Related Articles |
|
|