]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Merge from mainline.
authorAlan Modra <amodra@gmail.com>
Wed, 3 Apr 2002 00:05:32 +0000 (00:05 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 3 Apr 2002 00:05:32 +0000 (00:05 +0000)
2002-03-28  Alan Modra  <amodra@bigpond.net.au>
* cpu-mips.c (mips_compatible): Make static, prototype.

2002-03-14  Alan Modra  <amodra@bigpond.net.au>
* cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
(N): Use the above.

bfd/ChangeLog
bfd/cpu-mips.c

index 30e5ffeba31fd82a1da1abfd78c69f189059e8bc..e6f1b5477bfade3916cfa3af957c38b747fdad4a 100644 (file)
@@ -1,3 +1,13 @@
+2002-04-03  Alan Modra  <amodra@bigpond.net.au>
+
+       Merge from mainline.
+       2002-03-28  Alan Modra  <amodra@bigpond.net.au>
+       * cpu-mips.c (mips_compatible): Make static, prototype.
+
+       2002-03-14  Alan Modra  <amodra@bigpond.net.au>
+       * cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
+       (N): Use the above.
+
 2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>
 
        * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
index 888d863124e640e116b82673a2f3b3fe7795eed0..d54b0a5589143cdb47d9012538344e15aa54a638 100644 (file)
@@ -1,5 +1,5 @@
 /* bfd back-end for mips support
-   Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000
+   Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support.
 
@@ -23,6 +23,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 
+static const bfd_arch_info_type *mips_compatible
+  PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+
+/* The default routine tests bits_per_word, which is wrong on mips as
+   mips word size doesn't correlate with reloc size.  */
+
+static const bfd_arch_info_type *
+mips_compatible (a, b)
+     const bfd_arch_info_type *a;
+     const bfd_arch_info_type *b;
+{
+  if (a->arch != b->arch)
+    return NULL;
+
+  if (a->mach > b->mach)
+    return a;
+
+  if (b->mach > a->mach)
+    return b;
+
+  return a;
+}
+
 #define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT)          \
   {                                                    \
     BITS_WORD, /*  bits in a word */                   \
@@ -34,7 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     PRINT,                                             \
     3,                                                 \
     DEFAULT,                                           \
-    bfd_default_compatible,                            \
+    mips_compatible,                                   \
     bfd_default_scan,                                  \
     NEXT,                                              \
   }