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
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: binutils at sources dot redhat dot com, geoffk at redhat dot com
- Date: Wed, 09 Jul 2003 10:32:41 +0930
- Subject: Re: [PATCH] revamp ppc_relax_section in elf32-ppc.c
- References: <1057278983.4902.21.camel@ghostwheel.sfbay.redhat.com>
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.
> + /* We're clearing the bits for R_PPC_ADDR16_HA
> + and R_PPC_ADDR16_LO here. */
> + t0 &= ~(0xffff >> 16);
Huh?
> + t1 &= ~(0xffff);
Why the extra parens?
> +
> + /* t0 is HA, t1 is lo */
> + t0 |= (((val >> 16) + ((val & 0x8000) ? 1 : 0)) & 0xffff);
Better is
t0 |= ((val + 0x8000) >> 16) & 0xffff;
> - 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.
--
Alan Modra
IBM OzLabs - Linux Technology Centre