This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] revamp ppc_relax_section in elf32-ppc.c
On Tue, 2003-07-08 at 18:02, Alan Modra wrote:
> On Thu, Jul 03, 2003 at 05:36:23PM -0700, Eric Christopher wrote:
> > +/* Fake relocation. */
> > +#define R_PPC_RELAX32 251
>
> I prefer to have this in include/elf/ppc.h.
I did it this way since it is a fake relocation that should only be
local to the linker...
>
> > + /* We're clearing the bits for R_PPC_ADDR16_HA
> > + and R_PPC_ADDR16_LO here. */
> > + t0 &= ~(0xffff >> 16);
>
> Huh?
>
Hmm?
> > + t1 &= ~(0xffff);
>
> Why the extra parens?
>
habit :)
> > +
> > + /* t0 is HA, t1 is lo */
> > + t0 |= (((val >> 16) + ((val & 0x8000) ? 1 : 0)) & 0xffff);
>
> Better is
> t0 |= ((val + 0x8000) >> 16) & 0xffff;
OK. I just copied it straight out of the ABI doc :)
>
> > - contents = bfd_malloc (isec->_raw_size);
> > + contents = (bfd_byte *) bfd_malloc (isec->_raw_size);
>
> No need for the cast these days. Otherwise looks OK to install.
OK. I'll commit later today.
-eric
--
Eric Christopher <echristo@redhat.com>