OK. The only use for SYMBOL_SEARCHED_BY_DEMANGLED_NAME is to answer
the question, "Do we need to index this minimal symbol under its
demangled name?" It would work to re-write the test in
build_minimal_symbol_hash_tables as
if (SYMBOL_SEARCH_NAME (msym) != SYMBOL_LINKAGE_NAME (msym))
add_minsym_to_demangled_hash_table (msym,
objfile->msymbol_demangled_hash);
from the current
if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
...
(although to use !=, you'd also want to document the fact that when
SYMBOL_SEARCH_NAME is strcmp-equal to SYMBOL_LINKAGE_NAME, it is also
pointer equal). This re-write avoids introducing a new name, answering
one of your objections. Furthermore, minimal symbols are searched for only
by the linkage name or the search name (by definition), so it seems that the
proposed test is correct.
What do you think?