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


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.)

Thanks.

--- 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)
     {

--- binutils-2.17/bfd/archures.c.orig   Sun Jul  9 03:54:33 2006
+++ binutils-2.17/bfd/archures.c        Sun Jul  9 03:55:53 2006
@@ -690,6 +690,10 @@ bfd_arch_get_compatible (const bfd *abfd
       return NULL;
     }
 
+  /* An architecture is compatible with itself. */
+  if (abfd->arch_info == bbfd->arch_info)
+    return abfd->arch_info;
+
   /* Otherwise architecture-specific code has to decide.  */
   return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info);
 }


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