This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] implement correct alignment for Mach-O archive entries
- From: Nathan Froyd <froydnj at mozilla dot com>
- To: Matt Thomas <matt at 3am-software dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 29 Oct 2013 11:15:20 -0700 (PDT)
- Subject: Re: [PATCH] implement correct alignment for Mach-O archive entries
- Authentication-results: sourceware.org; auth=none
- References: <1383069256-19868-1-git-send-email-froydnj at mozilla dot com> <05C48A61-EACE-46B4-9E5B-A550DE9AAC83 at 3am-software dot com>
----- Original Message -----
> On Oct 29, 2013, at 10:54 AM, Nathan Froyd <email@example.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.