pe-coff BFD breakage

Ian Lance Taylor ian@zembu.com
Sun Aug 8 09:29:00 GMT 1999


   Date: Sat, 07 Aug 1999 22:51:21 -0500
   From: Mumit Khan <khan@xraylith.wisc.EDU>

   The following BFD patch breaks pe-coff targets:

   1999-08-05  Ian Lance Taylor  <ian@zembu.com>

	   Based on patches from Donn Terry <donn@interix.com>:
	   * coffcode.h (enum coff_symbol_classification): Define.
	   (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to
	   _bfd_coff_classify_symbol.  Change return type.
	   (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global.
	   (coff_slurp_symbol_table): Use coff_classify_symbol.
	   (coff_classify_symbol): New static function.
	   (coff_sym_is_global): Never define.
	   (bfd_coff_std_swap_table): Initialize with coff_classify_symbol.
	   * cofflink.c (coff_link_check_ar_symbols): Use
	   bfd_coff_classify_symbol rather than bfd_coff_sym_is_global.
	   (coff_link_add_symbols): Likewise.
	   (_bfd_coff_link_input_bfd): Likewise.
	   * coff-sh.c (bfd_coff_small_swap_table): Initialize with
	   coff_classify_symbol.
	   * libcoff.h: Rebuild.

   If I revert this, I can get the current CVS tree to build executables.
   Otherwise, windows won't load the executables.

Could you see if this patch fixes the problem?

Otherwise, could you send me a complete test case that I can look at
without building cygwin?  (i.e., .o files, .dll files, and a copy of
the good and bad executables).

Ian

Index: coffcode.h
===================================================================
RCS file: /cvs/binutils/binutils/bfd/coffcode.h,v
retrieving revision 1.9
diff -u -p -r1.9 coffcode.h
--- coffcode.h	1999/08/05 21:01:37	1.9
+++ coffcode.h	1999/08/08 16:28:14
@@ -3911,6 +3911,10 @@ coff_classify_symbol (abfd, syment)
 	  return COFF_SYMBOL_LOCAL;
 	}
 
+#if 0
+      /* This is correct for Microsoft generated objects, but it
+         breaks gas generated objects.  */
+
       if (syment->n_value == 0)
 	{
 	  asection *sec;
@@ -3923,6 +3927,7 @@ coff_classify_symbol (abfd, syment)
 		  == 0))
 	    return COFF_SYMBOL_PE_SECTION;
 	}
+#endif
 
       return COFF_SYMBOL_LOCAL;
     }


More information about the Binutils mailing list