From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10338 invoked by alias); 9 Jul 2003 01:02:45 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 10329 invoked from network); 9 Jul 2003 01:02:45 -0000 Received: from unknown (HELO mta07bw.bigpond.com) (144.135.24.134) by sources.redhat.com with SMTP; 9 Jul 2003 01:02:45 -0000 Received: from bubble.local ([144.135.24.81]) by mta07bw.email.bigpond.com (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HHQ00IRKG81BE@mta07bw.email.bigpond.com> for binutils@sources.redhat.com; Wed, 09 Jul 2003 11:02:27 +1000 (EST) Received: from cpe-144-136-188-60.sa.bigpond.net.au ([144.136.188.60]) by bwmam05bpa.bigpond.com(MailRouter V3.2g 44/1862547); Wed, 09 Jul 2003 11:02:27 +0000 Received: (qmail 28031 invoked by uid 179); Wed, 09 Jul 2003 01:02:41 +0000 Date: Wed, 09 Jul 2003 01:02:00 -0000 From: Alan Modra Subject: Re: [PATCH] revamp ppc_relax_section in elf32-ppc.c In-reply-to: <1057278983.4902.21.camel@ghostwheel.sfbay.redhat.com> To: Eric Christopher Cc: binutils@sources.redhat.com, geoffk@redhat.com Mail-followup-to: Eric Christopher , binutils@sources.redhat.com, geoffk@redhat.com Message-id: <20030709010241.GJ27544@bubble.sa.bigpond.net.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: Mutt/1.4i References: <1057278983.4902.21.camel@ghostwheel.sfbay.redhat.com> X-SW-Source: 2003-07/txt/msg00145.txt.bz2 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