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: [PATCH] implement correct alignment for Mach-O archive entries


----- Original Message -----
> On Oct 29, 2013, at 10:54 AM, Nathan Froyd <froydnj@mozilla.com> wrote:
> 
> > +  if (bfd_get_flavour (abfd) == bfd_target_mach_o_flavour)
> > +    ptr += ptr % 4;
> > +  else
> 
> That does not pad to 4.

Ah, it doesn't quite.  We probably get lucky in that PTR is always even,
where that formula does work.

> ptr += 4 - (ptr % 4);

This pads unnecessarily when ptr is a multiple of 4 already.

-Nathan


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