diff options
author | Alan Modra <amodra@gmail.com> | 2023-07-21 16:57:18 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-07-26 10:23:27 +0930 |
commit | eb14a8b4bfb767beebfb54d7911da4132b5c0f94 (patch) | |
tree | 09953b7f145bdd9c8c58dbfd1b2824a87efc4ea5 /gold/powerpc.cc | |
parent | 0d8e39f5ce5530cf548ca8a70ff19a34991e43cb (diff) | |
download | gdb-eb14a8b4bfb767beebfb54d7911da4132b5c0f94.zip gdb-eb14a8b4bfb767beebfb54d7911da4132b5c0f94.tar.gz gdb-eb14a8b4bfb767beebfb54d7911da4132b5c0f94.tar.bz2 |
[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.
Diffstat (limited to 'gold/powerpc.cc')
-rw-r--r-- | gold/powerpc.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc index d62bdea..e66d9cb 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -12420,17 +12420,24 @@ Target_powerpc<size, big_endian>::Relocate::relocate( && gsym->is_undefined() && is_branch_reloc<size>(r_type)))) { + std::string name; + if (gsym) + name = gsym->demangled_name(); + else + name = relinfo->object->get_symbol_name(r_sym); if (os->flags() & elfcpp::SHF_ALLOC) { gold_error_at_location(relinfo, relnum, rela.get_r_offset(), - _("relocation overflow")); + _("reloc type %u overflow against '%s'"), + r_type, name.c_str()); if (has_stub_value) gold_info(_("try relinking with a smaller --stub-group-size")); } else { gold_warning_at_location(relinfo, relnum, rela.get_r_offset(), - _("relocation overflow")); + _("reloc type %u overflow against '%s'"), + r_type, name.c_str()); gold_info(_("debug info may be unreliable, compile with -gdwarf64")); } } |