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]

Fix rs6000 compatibility predicate


The code for bfd/cpu-rs6000.c:rs6000_compatible looks wrong to me.
The logic there says that A, which we assert to be a bfd_arch_rs6000,
is only compatible with a B whose arch is bfd_arch_powerpc and whose
mach is bfd_mach_rs6k.  But that's an rs6000 mach, not a powerpc mach;
there should never be a bfd_arch_powerpc / bfd_mach_rs6k arch info.
Is that right?

The code as changed by the patch below would make more sense to me:
all powerpc machines are supersets of the base rs6000 machine, but
there the two lines diverged, so any later model of the rs6000 is
incompatible with any later powerpc model.

2003-10-21  Jim Blandy  <jimb@redhat.com>

	* cpu-rs6000.c (rs6000_compatible): Check the correct arch_info
	object's mach field: all PowerPC machines are supersets of the
	original rs6000, but not later rs6000 machines.

Index: bfd/cpu-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-rs6000.c,v
retrieving revision 1.5
diff -c -r1.5 cpu-rs6000.c
*** bfd/cpu-rs6000.c	30 Nov 2002 08:39:36 -0000	1.5
--- bfd/cpu-rs6000.c	21 Oct 2003 17:31:40 -0000
***************
*** 47,53 ****
      case bfd_arch_rs6000:
        return bfd_default_compatible (a, b);
      case bfd_arch_powerpc:
!       if (b->mach == bfd_mach_rs6k)
  	return b;
        return NULL;
      }
--- 47,53 ----
      case bfd_arch_rs6000:
        return bfd_default_compatible (a, b);
      case bfd_arch_powerpc:
!       if (a->mach == bfd_mach_rs6k)
  	return b;
        return NULL;
      }


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