This is the mail archive of the binutils@sourceware.org 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: RFC: Unify overflow checking


Hi Daniel,

Does anyone remember why bfd_check_overflow and _bfd_relocate_contents
have different overflow checks?

Well bfd_relocate_contents has to deal with whatever is the location being relocated whereas bfd_check_overflow just has to examine an already relocated value.


> It looks to me as if the ones in
> _bfd_relocate_contents are always appropriate, and bfd_check_overflow
> is simply stale.

I agree that this is probably true, so some code simplification would be welcome.

This (untested so far) patch unifies them.

It does not work either. (For example it tests a variable called 'x' which has not been defined). It is the right general idea though, should you feel like cleaning it up and testing it.


Cheers
  Nick




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