This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6000 C++ name demangling

Hello,


after linking, the memory map shows several symbols like the following:

808b0080   __sti___10_Logger_cpp_0b2ae32b
80870f20   __sti___10_Thread_cpp_0b2ae32b
808f2460   __sti___10_assert_cpp_0b2ae32b
808cab80   __sti___11_AudioIn_cpp_0b2ae32b
8087bc20   __sti___11_CDabDec_cpp_0b2ae32b
80880380   __sti___11_CDmbDec_cpp_0b2ae32b

What do those symbol names mean?

Background: I have to classes called "Logger" but in different namespaces. After compiling just fine, the linker sees a duplicate symbol (__sti___10_Logger_cpp_0b2ae32b) in two different archives and exits with an error.


Regards,

Martin

  • Those are functions which initialize global variables.  (Note: although the names are mangled, they are a special form which cannot be demangled by dem6x.)

    For each global variable with a constructor, a dummy function named __sti__* is created to call that constructor.  The address of every __sti__* function is stored in the .pinit array (.init_array in EABI), and the startup code arranges to call all of those function before the main function starts.

    From the name of the function, I would say that the function is created for the input file Logger.cpp.  The duplicate symbol error suggests that perhaps you are including Logger.obj in your build twice?