This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold] Error out when there is an access beyond the end of the merged section
- From: Cary Coutant <ccoutant at google dot com>
- To: Alexander Ivchenko <aivchenk at gmail dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Tue, 1 Jul 2014 13:18:19 -0700
- Subject: Re: [gold] Error out when there is an access beyond the end of the merged section
- Authentication-results: sourceware.org; auth=none
- References: <CACysShj9wK3e1eC56TffaOQknD4A8XF3NVcyYUNAKEPOux2E8w at mail dot gmail dot com>
> +2014-07-01 Alexander Ivchenko <alexander.ivchenko@intel.com>
> +
> + * merge.cc (Object_merge_map::get_output_offset): error out when we see
> + that there is an access beyond the end of the merged section.
> + * merge.h (Object_merge_map::get_output_offset): Add new argument.
> + (Merge_map::get_output_offset): Adjust
> + Object_merge_map::get_output_offset call with additional argument.
> + * reloc.cc (Merged_symbol_value<size>::value_from_output_section):
> + Ditto.
I don't think Object_merge_map or Merge_map should be printing this
error. Instead, I'd prefer to issue the error from
Merged_symbol_value::value_from_output_section in place of the
gold_assert. Everything needed to print the error message is readily
available there.
It would be nice to print the section name as well as the offset. You
should just be able to replace gold_assert with this:
if (!found)
{
object->error(_("access beyond end of merged section (%s+%ld)"),
object->section_name(input_shndx),
static_cast<long>(input_offset));
return 0;
}
Thanks for looking at this!
-cary