This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Fix "FAIL: objcopy (simple copy)" for tic54x-coff


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  <hongjiu.lu@intel.com>

	* 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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]