From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16672 invoked by alias); 21 Feb 2005 21:09:19 -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 16632 invoked from network); 21 Feb 2005 21:09:11 -0000 Received: from unknown (HELO rwcrmhc11.comcast.net) (204.127.198.35) by sourceware.org with SMTP; 21 Feb 2005 21:09:11 -0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (rwcrmhc11) with ESMTP id <2005022121091001300qjqb3e>; Mon, 21 Feb 2005 21:09:10 +0000 Received: by lucon.org (Postfix, from userid 1000) id C1A7365604; Mon, 21 Feb 2005 13:09:09 -0800 (PST) Date: Tue, 22 Feb 2005 00:15:00 -0000 From: "H. J. Lu" To: binutils@sources.redhat.com Subject: PATCH: Fix "FAIL: objcopy (simple copy)" for tic54x-coff Message-ID: <20050221210909.GA14151@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2005-02/txt/msg00482.txt.bz2 TI relocation has a r_reserved field. But we never initialize it and we get some random values. This patch makes sure that it is always initialized. H.J. ---- bfd/ 2005-02-21 H.J. Lu * coffcode.h (coff_write_relocs): Clear the r_reserved field if COFF_REL_HAS_R_RESERVED is defined before swapping out relocation. include/coff/ 2005-02-21 H.J. Lu * ti.h (COFF_REL_HAS_R_RESERVED): Defined. * tic80.h (COFF_REL_HAS_R_RESERVED): Defined. --- binutils/bfd/coffcode.h.ti 2005-02-21 10:18:36.000000000 -0800 +++ binutils/bfd/coffcode.h 2005-02-21 13:03:05.178091748 -0800 @@ -2510,6 +2510,10 @@ coff_write_relocs (abfd, first_undef) if (bfd_seek (abfd, s->rel_filepos, SEEK_SET) != 0) return FALSE; +#ifdef COFF_REL_HAS_R_RESERVED + memset (&dst.r_reserved, 0, sizeof (dst.r_reserved)); +#endif + #ifdef COFF_WITH_PE if (obj_pe (abfd) && s->reloc_count >= 0xffff) { --- binutils/include/coff/ti.h.ti 2003-08-07 09:02:59.000000000 -0700 +++ binutils/include/coff/ti.h 2005-02-21 12:49:58.767373577 -0800 @@ -441,6 +441,9 @@ union external_auxent { /********************** RELOCATION DIRECTIVES **********************/ +/* Relocation has r_reserved. */ +#define COFF_REL_HAS_R_RESERVED 1 + struct external_reloc_v0 { char r_vaddr[4]; --- binutils/include/coff/tic80.h.ti 2001-03-15 15:06:40.000000000 -0800 +++ binutils/include/coff/tic80.h 2005-02-21 12:50:23.729673155 -0800 @@ -81,6 +81,9 @@ struct external_scnhdr /********************** RELOCATION DIRECTIVES **********************/ +/* Relocation has r_reserved. */ +#define COFF_REL_HAS_R_RESERVED 1 + /* The external reloc has an offset field, because some of the reloc types on the h8 don't have room in the instruction for the entire offset - eg the strange jump and high page addressing modes. */