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?

3
  • No namespace support? That has to be back in the Sun Workshop days.
    – fpmurphy
    Commented Sep 11, 2018 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. Commented Sep 11, 2018 at 11:54
  • I wonder if someone on Retrocomputing can find the info...
    – Igor Skochinsky
    Commented Sep 12, 2018 at 10:42

2 Answers 2

2

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

mangling.ps

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
2
  • 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
    Commented Sep 10, 2018 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
    Commented Sep 12, 2018 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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