Running the test case with upstream gdb shows two failures:
(1) Receiving different error messages when printing TLS variable
before
program runs - because the ARM compiler does not emit dwarf
attribute
DW_AT_location for TLS, the result is expected and the baseline may
need to be changed for aarch64.
(2) Using "info address" command on C++ static TLS object resulted in
"symbol unresolved" error - below is a snippet from the test case:
class K {
public:
static __thread int another_thread_local;
};
__thread int K::another_thread_local;
(gdb) info address K::another_thread_local
Symbol "K::another_thread_local" is unresolved.
This patch contains fix for (2).
Function info_address_command() handles the "info address" command and
calls lookup_minimal_symbol_and_objfile() to find sym's symbol entry in
minimal symbol table if SYMBOL_COMPUTED_OPS (sym) is false. Problem is
that function lookup_minimal_symbol_and_objfile() only looked up an
objfile's minsym ordinary hash table, not its demangled hash table,
which
was the reason why the C++ name was not found.
The fix is to replace the lookup_minimal_symbol_and_objfile() call with
the lookup_bound_minimal_symbol() call, which looks up entries in both
minsym's hash tables, via lookup_minimal_symbol(), to find symbol entry
that's associated with the demangled name.