This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: eu-strip --reloc-debug-sections
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 27 May 2011 11:53:17 -0700
- Subject: Re: eu-strip --reloc-debug-sections
> On Tue, 2011-05-24 at 11:40 -0700, Roland McGrath wrote:
> > > + if (offset + size > tdata->d_size)
> > > + error (0, 0, gettext ("bad relocation"));
> >
> > It's the style of the robustify branch, and IMHO might as well do it to
> > start with in the new code, to do these checks in overflow-proof ways.
>
> Do you mean adding something like:
>
> if (offset + size > tdata->d_size
> || offset > ((GElf_Addr) -1) - size)
>
> Or is there a more natural way to check unsigned overflow in these
> cases?
offset > tdata->d_size || tdata->d_size - offset < size