This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold] Error out when there is an access beyond the end of the merged section

> +2014-07-01  Alexander Ivchenko  <>
> +
> + * (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.
> + * (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)"),
      return 0;

Thanks for looking at this!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]