RFC: Unify overflow checking

Nick Clifton nickc@redhat.com
Thu May 1 16:42:00 GMT 2008


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





More information about the Binutils mailing list