This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Unify overflow checking
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 01 May 2008 17:42:07 +0100
- Subject: Re: RFC: Unify overflow checking
- References: <20080422140755.GA7126@caradoc.them.org>
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