From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29935 invoked by alias); 23 Feb 2005 00:05:40 -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 28363 invoked from network); 23 Feb 2005 00:04:07 -0000 Received: from unknown (HELO rwcrmhc12.comcast.net) (216.148.227.85) by sourceware.org with SMTP; 23 Feb 2005 00:04:07 -0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (rwcrmhc12) with ESMTP id <2005022300040701400hnnk1e>; Wed, 23 Feb 2005 00:04:07 +0000 Received: by lucon.org (Postfix, from userid 1000) id BED2565604; Tue, 22 Feb 2005 16:04:06 -0800 (PST) Date: Wed, 23 Feb 2005 08:03:00 -0000 From: "H. J. Lu" To: Nick Clifton Cc: Alan Modra , binutils@sources.redhat.com Subject: Re: PATCH: Fix "FAIL: objcopy (simple copy)" for tic54x-coff Message-ID: <20050223000406.GA14098@lucon.org> References: <20050221210909.GA14151@lucon.org> <20050222005716.GE900@bubble.modra.org> <421B5DC3.50809@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <421B5DC3.50809@redhat.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-02/txt/msg00534.txt.bz2 On Tue, Feb 22, 2005 at 04:28:51PM +0000, Nick Clifton wrote: > Hi Alan, Hi H.J. > > >> * coffcode.h (coff_write_relocs): Clear the r_reserved field > >> if COFF_REL_HAS_R_RESERVED is defined before swapping out > >> relocation. > > >This should really be done by defining a coff_SWAP_reloc_out function > >for these targets. > > I agree with Alan - why not define the SWAP_OUT_RELOC_EXTRA macro for > the tic54x-coff port and have that write out zeros for the r_reserved > field ? > Here is the patch. H.J. ---- 2005-02-22 H.J. Lu * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Defined. * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Likewise. --- bfd/coff-tic54x.c.ti 2004-08-12 20:15:56.000000000 -0700 +++ bfd/coff-tic54x.c 2005-02-22 16:01:59.728220997 -0800 @@ -328,6 +328,15 @@ ticoff_bfd_is_local_label_name (abfd, na #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name +/* Clear the r_reserved field in relocs. */ +#define SWAP_OUT_RELOC_EXTRA(abfd,src,dst) \ + do \ + { \ + dst->r_reserved[0] = 0; \ + dst->r_reserved[1] = 0; \ + } \ + while (0) + /* Customize coffcode.h; the default coff_ functions are set up to use COFF2; coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1 and COFF0 vectors use custom _bad_format_hook procs instead of setting --- bfd/coff-tic80.c.ti 2004-11-05 14:41:32.000000000 -0800 +++ bfd/coff-tic80.c 2005-02-22 15:41:06.000000000 -0800 @@ -714,6 +714,15 @@ coff_tic80_relocate_section (output_bfd, return TRUE; } +/* Clear the r_reserved field in relocs. */ +#define SWAP_OUT_RELOC_EXTRA(abfd,src,dst) \ + do \ + { \ + dst->r_reserved[0] = 0; \ + dst->r_reserved[1] = 0; \ + } \ + while (0) + #define TIC80COFF 1 /* Customize coffcode.h */ #undef C_AUTOARG /* Clashes with TIc80's C_UEXT */ #undef C_LASTENT /* Clashes with TIc80's C_STATLAB */