5

I have a few SPARC binaries that have been compiled with what seems to be the SunPro CC compiler. The symbols in the binary are referring to a very early C++ implementation (pre-namespaces) and look like this:

__0oHistreamrsRUl.
__0oHistreamrsRi.
__0oHistreamrsRf.
__0oKistrstreamdtv.
__0oHistreamrsPc.
__0oKistrstreamctPCc.
__0oNIostream_initdtv.
__0oNIostream_initctv.

Looking at these, I'm guessing that they correspond to the following methods:

istream::operator >>(unsigned long);
istream::operator >>(int);
istream::operator >>(float);
istream::~istream();
istream::operator >>(char *);
istream::operator(const char *);
ostream_init::~ostream_init();
ostream_init::ostream_init();

To make further progress, I want to understand the mangling scheme used here, but my Google-fu is too weak. Where can I find documentation on the name mangling scheme used here?

  • No namespace support? That has to be back in the Sun Workshop days. – fpmurphy Sep 11 '18 at 2:37
  • 2
    The binary is over 15 years old. I can make some guesses as to the mangling scheme (__0 prefix, H = symbol of 7 chars follows, etc) but it would be nice to have a reference. I've searched open source repositories hoping to find a demangler but haven't found one that understands this particular demangling scheme. – John Källén Sep 11 '18 at 11:54
  • I wonder if someone on Retrocomputing can find the info... – Igor Skochinsky Sep 12 '18 at 10:42
2

I found the following documentation on archive.org, as part of Sun WorkShop™ for Solaris 2.x

mangling.ps

| improve this answer | |
2

You should be able to use c++filt directly. Pay attention to not use the one from binutils. Make sure to use the right install path, eg:

  • /opt/SolarisStudio/solarisstudio12.3/prod/bin/c++filt
| improve this answer | |
  • 3
    while this helps with the specific problem, it does not actually address the question as asked; are there any docs on the mangling scheme used? – Igor Skochinsky Sep 10 '18 at 19:29
  • @IgorSkochinsky That's an actual pretty good exercise to do then ! If OP has access to compiler, it should be possible to write the documentation (eg. itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling) – tibar Sep 12 '18 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.