This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Ping: [PATCH] objcopy: fix 32-bit build
On Wed, Jan 24, 2018 at 12:53:17AM -0700, Jan Beulich wrote:
> >>> On 10.01.18 at 10:32, <JBeulich@suse.com> wrote:
> > --- a/binutils/objcopy.c
> > +++ b/binutils/objcopy.c
> > @@ -2064,7 +2064,7 @@ merge_gnu_build_notes (bfd * abfd, asect
> > For now though, since v1 and v2 was not intended to
> > handle gaps, we chose an artificially large end
> > address. */
> > - end = (bfd_vma) 0x7ffffffffffffffUL;
> > + end = ~((bfd_vma)1 << 63);
> > break;
> >
> > case 8:
> > @@ -2083,7 +2083,7 @@ merge_gnu_build_notes (bfd * abfd, asect
> > For now though, since v1 and v2 was not intended to
> > handle gaps, we chose an artificially large end
> > address. */
> > - end = (bfd_vma) 0x7ffffffffffffffUL;
> > + end = ~((bfd_vma)1 << 63);
> > }
> > break;
Why not use "(bfd_vma) -1"? Won't this complain about shift count
exceeding width of type when bfd_vma is 32-bit? (And if you don't get
a warning, there is at least a possibility of an all-ones bit pattern
when 32-bit while 64-bit will have the MSB zero. A difference I don't
like.)
--
Alan Modra
Australia Development Lab, IBM