diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-03-14 10:38:31 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2002-03-14 10:38:31 +0000 |
commit | c81cc7881dd02c1b9ca77e5bc0a0311fe57c535d (patch) | |
tree | ca09c373a70418b2ca18d5db5a43c644a60c8a81 /bfd/cpu-mips.c | |
parent | ffcc44d557a44d87b44ced0ea5515caf56c957bd (diff) | |
download | binutils-redhat-c81cc7881dd02c1b9ca77e5bc0a0311fe57c535d.tar.gz |
* cpu-mips.c (mips_compatible): New. Don't check bits_per_word.
(N): Use the above.
* elflink.h (elf_bfd_final_link): Revert last change. Instead,
ensure reloc size matches before calling elf_link_input_bfd.
Add an assert to check reloc size when counting output relocs.
Diffstat (limited to 'bfd/cpu-mips.c')
-rw-r--r-- | bfd/cpu-mips.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c index 888d863124..10dd0b748c 100644 --- a/bfd/cpu-mips.c +++ b/bfd/cpu-mips.c @@ -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,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" +/* The default routine tests bits_per_word, which is wrong on mips as + mips word size doesn't correlate with reloc size. */ + +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 +54,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, \ } |