[GOLD] reporting local symbol names
authorAlan Modra <amodra@gmail.com>
Fri, 21 Jul 2023 07:27:18 +0000 (16:57 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 26 Jul 2023 00:53:27 +0000 (10:23 +0930)
commiteb14a8b4bfb767beebfb54d7911da4132b5c0f94
tree09953b7f145bdd9c8c58dbfd1b2824a87efc4ea5
parent0d8e39f5ce5530cf548ca8a70ff19a34991e43cb
[GOLD] reporting local symbol names

get_symbol_name currently returns "" for the usual STT_SECTION symbols
generated by gas.  That's not very helpful, return the section name.
Demangle local symbols too, fixing an inconsistency in
issue_discarded_error where global symbols are demangled.

* object.cc (Sized_relobj_file::get_symbol_name): Return a
std::string.  Return section name for STT_SECTION symbols with
zero st_name.  Sanity check st_name, and don't run off the end
of an improperly terminated .strtab.  Demangle sym names.
* object.h (Sized_relobj_file::get_symbol_name): Update decl.
* target-reloc.h (issue_discarded_error): Adjust.
* powerpc.cc (Target_powerpc::Relocate::relocate): Report reloc
type and symbol for relocation overflows.
gold/object.cc
gold/object.h
gold/powerpc.cc
gold/target-reloc.h