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: For 2.12: sh-coff


Daniel Jacobowitz <drow@mvista.com> writes:

> On Sun, Feb 17, 2002 at 05:37:17PM -0800, Ian Lance Taylor wrote:
> > Daniel Jacobowitz <drow@mvista.com> writes:
> > 
> > > This has come up before on this list, but apparently was never fixed.  I
> > > only recall it being discussed in terms of archives, but the problem is more
> > > general.  From the testsuite:
> > > 
> > > /opt/src/binutils/obj-sh-coff/ld/ld-new  -o tmpdir/asm.x --check-sections tmpdir/asm.o
> > > tmpdir/asm.o: file not recognized: File format is ambiguous
> > > tmpdir/asm.o: matching formats: coff-shl coff-shl-small
> > > 
> > > Anyone?
> > 
> > What is in the bfd_default_vector array in your ld-new executable?
> 
> Only shcoff_vec.  Which is, of course, big endian.  Yet GAS seems to be
> producing coff-shl by default.

This patch, which Nick checked in on November 15 with an unrelated
ChangeLog entry, shows that gas will always generate a little endian
object.

2001-11-15  Nick Clifton  <nickc@cambridge.redhat.com>

	* cgen.c, config/obj-coff.c, config/tc-*.c: Update all occurances
	of md_apply_fix to md_apply_fix3.
	Make all md_apply_fix3 functions void.

-- obj-coff.h  2001/03/08 23:24:22     1.11
+++ obj-coff.h  2001/11/15 21:28:54     1.12
@@ -121,10 +121,17 @@
 #ifdef TE_PE
 #define TARGET_FORMAT "pe-shl"
 #else
+
+#if 0 /* FIXME: The "shl" varaible does not appear to exist.  What happened to it ?  */
 #define TARGET_FORMAT                                  \
   (shl                                                 \
    ? (sh_small ? "coff-shl-small" : "coff-shl")                \
    : (sh_small ? "coff-sh-small" : "coff-sh"))
+#else
+#define TARGET_FORMAT                                  \
+   (sh_small ? "coff-shl-small" : "coff-shl") 
+#endif
+
 #endif
 #endif


The shl variable disappeared in this patch on October 16.

2001-10-16  NIIBE Yutaka  <gniibe@m17n.org>,
	    Hans-Peter Nilsson  <hp@bitrange.com>

	* config/tc-sh.c (shl): Remove.
	(big): New function.
	(little): Remove shl handling.  Emit error for endian mismatch.
	(md_show_usage): Add description of -big.
	(md_parse_option): Handle OPTION_BIG.  Remove shl handling.
	(OPTION_BIG): Add.
	(md_pseudo_table): Add .big.
	(md_longopts): Add -big.
	(md_begin): Don't set target_big_endian here.
	* config/tc-sh.h (TARGET_BYTES_BIG_ENDIAN): Remove.
	(LISTING_HEADER, COFF_MAGIC, TARGET_FORMAT): Use target_big_endian.
	(shl): Remove.
	* configure.in (endian): Default is big.
	(sh-*-pe*): Little endian.
	(cpu_type): Set sh for target sh*.
	* configure: Regenerate.

I would guess that the October 16 patch was not tested for sh-coff.

I imagine that the correct fix is to restore the old obj-coff.h
setting of TARGET_FORMAT, but have it test target_big_endian rather
than shl.

Ian


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