diff options
author | Cary Coutant <ccoutant@gmail.com> | 2016-02-07 10:17:01 -0800 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2016-02-07 10:17:01 -0800 |
commit | 17ecd016113c77c7fead1725d2d315fe7b42aced (patch) | |
tree | 8dba3cbc4b27623d56124db86f568aab958526d0 /gold/x86_64.cc | |
parent | 7c8b700c92444fca9ee81ab3844baadac0bdd4e3 (diff) | |
download | gdb-17ecd016113c77c7fead1725d2d315fe7b42aced.zip gdb-17ecd016113c77c7fead1725d2d315fe7b42aced.tar.gz gdb-17ecd016113c77c7fead1725d2d315fe7b42aced.tar.bz2 |
Add additional information to relocation overflow errors.
gold/
PR gold/18695
* x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
information to relocation overflow errors.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r-- | gold/x86_64.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc index b0780af..81126ef 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -3701,8 +3701,30 @@ Target_x86_64<size>::Relocate::relocate( } if (rstatus == Reloc_funcs::RELOC_OVERFLOW) - gold_error_at_location(relinfo, relnum, rela.get_r_offset(), - _("relocation overflow")); + { + if (gsym == NULL) + { + unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info()); + gold_error_at_location(relinfo, relnum, rela.get_r_offset(), + _("relocation overflow: " + "reference to local symbol %u in %s"), + r_sym, object->name().c_str()); + } + else if (gsym->is_defined() && gsym->source() == Symbol::FROM_OBJECT) + { + gold_error_at_location(relinfo, relnum, rela.get_r_offset(), + _("relocation overflow: " + "reference to '%s' defined in %s"), + gsym->name(), + gsym->object()->name().c_str()); + } + else + { + gold_error_at_location(relinfo, relnum, rela.get_r_offset(), + _("relocation overflow: reference to '%s'"), + gsym->name()); + } + } return true; } |