- symbols) to an existing objfile.
-
- Because of the way minimal symbols are collected, we generally have no way
- of knowing what source language applies to any particular minimal symbol.
- Specifically, we have no way of knowing if the minimal symbol comes from a
- C++ compilation unit or not. So for the sake of supporting cached
- demangled C++ names, we have no choice but to try and demangle each new one
- that comes in. If the demangling succeeds, then we assume it is a C++
- symbol and set the symbol's language and demangled name fields
- appropriately. Note that in order to avoid unnecessary demanglings, and
- allocating obstack space that subsequently can't be freed for the demangled
- names, we mark all newly added symbols with language_auto. After
- compaction of the minimal symbols, we go back and scan the entire minimal
- symbol table looking for these new symbols. For each new symbol we attempt
- to demangle it, and if successful, record it as a language_cplus symbol
- and cache the demangled form on the symbol obstack. Symbols which don't
- demangle are marked as language_unknown symbols, which inhibits future
- attempts to demangle them if we later add more minimal symbols. */