This is the mail archive of the binutils@sourceware.org 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: binutils 2.17 warns m68k:cpu32 is incompatible with m68k:cpu32


"Matthew R. Dempsky" <mrd@alkemio.org> writes:
> On Fri, Jul 07, 2006 at 01:59:52PM -0500, Matthew R. Dempsky wrote:
>> When trying to link two or more cpu32 object files with ld from binutils
>> 2.17, I get a warning that the m68k:cpu32 architecture of any input
>> files beyond the first is incompatible with m68k:cpu32 output, which
>> seems very nonsensical.
>
> Below are two alternative patches that fix this problem for me.  (Be 
> warned, however, I have not done any testing beyond the test case in my 
> previous mail.)

You beat me to it!  I'd been planning on looking at your report today.

> --- binutils-2.17/bfd/cpu-m68k.c.orig   Sun Jul  9 03:43:28 2006
> +++ binutils-2.17/bfd/cpu-m68k.c        Sun Jul  9 03:56:43 2006
> @@ -202,6 +202,11 @@ bfd_m68k_compatible (const bfd_arch_info
>    if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
>      /* Merge m68k machine. */
>      return a->mach > b->mach ? a : b;
> +  else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32)
> +    /* CPU32 is compatible with itself. */
> +    return a;
>    else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
>            && b->mach >= bfd_mach_mcf_isa_a_nodiv)
>      {

This looks right to me.  I've added a changelog and testcase below.
OK to install?

Richard


bfd/
2006-07-10  Matthew R. Dempsky  <mrd@alkemio.org>

	* cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.

ld/testsuite/
2006-07-10  Richard Sandiford  <richard@codesourcery.com>

	* ld-m68k/merge-ok-1c.d: New test.
	* ld-m68k/m68k.exp: Run it.

Index: bfd/cpu-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-m68k.c,v
retrieving revision 1.13
diff -u -p -r1.13 cpu-m68k.c
--- bfd/cpu-m68k.c	25 Mar 2006 10:24:27 -0000	1.13
+++ bfd/cpu-m68k.c	10 Jul 2006 15:32:58 -0000
@@ -202,6 +202,9 @@ bfd_m68k_compatible (const bfd_arch_info
   if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
     /* Merge m68k machine. */
     return a->mach > b->mach ? a : b;
+  else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32)
+    /* CPU32 is compatible with itself. */
+    return a;
   else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
 	   && b->mach >= bfd_mach_mcf_isa_a_nodiv)
     {
Index: ld/testsuite/ld-m68k/m68k.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-m68k/m68k.exp,v
retrieving revision 1.3
diff -u -p -r1.3 m68k.exp
--- ld/testsuite/ld-m68k/m68k.exp	14 Jun 2006 08:27:41 -0000	1.3
+++ ld/testsuite/ld-m68k/m68k.exp	10 Jul 2006 15:32:58 -0000
@@ -53,6 +53,7 @@ run_dump_test "merge-error-1d"
 run_dump_test "merge-error-1e"
 run_dump_test "merge-ok-1a"
 run_dump_test "merge-ok-1b"
+run_dump_test "merge-ok-1c"
 
 foreach { id sources } { a { plt1.s } b { plt1-empty.s plt1.s } } {
     foreach arch { 68020 cpu32 isab } {
Index: ld/testsuite/ld-m68k/merge-ok-1c.d
===================================================================
RCS file: ld/testsuite/ld-m68k/merge-ok-1c.d
diff -N ld/testsuite/ld-m68k/merge-ok-1c.d
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-m68k/merge-ok-1c.d	10 Jul 2006 15:32:58 -0000
@@ -0,0 +1,6 @@
+#source: merge-error-1a.s -march=cpu32
+#source: merge-error-1b.s -march=cpu32
+#ld: -r
+#objdump: -p
+#...
+private flags = 810000: \[cpu32\]


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