From: Cary Coutant Date: Sun, 7 Feb 2016 18:17:01 +0000 (-0800) Subject: Add additional information to relocation overflow errors. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17ecd016113c77c7fead1725d2d315fe7b42aced;p=binutils-gdb.git 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. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index d824511082d..b796a246bba 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,12 @@ +2016-02-07 Cary Coutant + + PR gold/18695 + * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional + information to relocation overflow errors. + 2016-02-06 Cary Coutant + PR gold/18695 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32 overflow checking when symbol value + addend < 0. diff --git a/gold/x86_64.cc b/gold/x86_64.cc index b0780af1001..81126efc84e 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -3701,8 +3701,30 @@ Target_x86_64::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(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; }