2002-03-13 Alan Modra <amodra@bigpond.net.au>
+ * archures.c (bfd_default_compatible): Test bits_per_word.
+ * cpu-i386.c (i386_compatible): Remove. Replace occurrences with
+ bfd_default_compatible.
+ * cpu-i370.c (i370_compatible): Likewise.
+ * cpu-sparc.c (sparc_compatible): Likewise.
+ * cpu-h8300.c (compatible): Test in->arch == out->arch.
+
* elflink.h: Formatting fixes.
(elf_link_output_extsym): Merge undefined and undef weak cases.
if (a->arch != b->arch)
return NULL;
+ if (a->bits_per_word != b->bits_per_word)
+ return NULL;
+
if (a->mach > b->mach)
return a;
const bfd_arch_info_type *out;
{
/* It's really not a good idea to mix and match modes. */
- if (in->mach != out->mach)
+ if (in->arch != out->arch || in->mach != out->mach)
return 0;
else
return in;
#include "sysdep.h"
#include "libbfd.h"
-/* The common i360/370 architecture comes in many forms */
-
-static const bfd_arch_info_type *i370_compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
-static const bfd_arch_info_type *
-i370_compatible (a, b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
-{
- BFD_ASSERT (a->arch == bfd_arch_i370);
- switch (b->arch)
- {
- default:
- return NULL;
- case bfd_arch_i370:
- return bfd_default_compatible (a, b);
- }
- /*NOTREACHED*/
-}
-
static const bfd_arch_info_type arch_info_struct[] =
{
/* hack alert: old old machines are really 16 and 24 bit arch ... */
"i370:360",
3,
false, /* not the default */
- i370_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[1]
},
"i370:370",
3,
false, /* not the default */
- i370_compatible,
+ bfd_default_compatible,
bfd_default_scan,
0
},
"i370:common",
3,
true, /* the default */
- i370_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[0]
};
#include "sysdep.h"
#include "libbfd.h"
-/* Don't mix 32 bit and 64 bit files. */
-
-static const bfd_arch_info_type *i386_compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
-static const bfd_arch_info_type *
-i386_compatible (a, b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
-{
- if (a->bits_per_word != b->bits_per_word)
- return NULL;
-
- return bfd_default_compatible (a, b);
-}
-
const bfd_arch_info_type bfd_i386_arch_intel_syntax =
{
32, /* 32 bits in a word */
"i386:intel",
3,
true,
- i386_compatible,
+ bfd_default_compatible,
bfd_default_scan ,
0,
};
"x86-64:intel",
3,
true,
- i386_compatible,
+ bfd_default_compatible,
bfd_default_scan ,
&bfd_i386_arch_intel_syntax,
};
"i8086",
3,
false,
- i386_compatible,
+ bfd_default_compatible,
bfd_default_scan ,
&bfd_x86_64_arch_intel_syntax,
};
"x86-64",
3,
true,
- i386_compatible,
+ bfd_default_compatible,
bfd_default_scan ,
&i8086_arch,
};
"i386",
3,
true,
- i386_compatible,
+ bfd_default_compatible,
bfd_default_scan ,
&bfd_x86_64_arch
};
/* BFD support for the SPARC architecture.
- Copyright 1992, 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
+ Copyright 1992, 1995, 1996, 1998, 2000, 2002
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "sysdep.h"
#include "libbfd.h"
-/* Don't mix 32 bit and 64 bit files. */
-
-static const bfd_arch_info_type *sparc_compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
-static const bfd_arch_info_type *
-sparc_compatible (a, b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
-{
- if (a->bits_per_word != b->bits_per_word)
- return NULL;
-
- return bfd_default_compatible (a, b);
-}
-
static const bfd_arch_info_type arch_info_struct[] =
{
{
"sparc:sparclet",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[1],
},
"sparc:sparclite",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[2],
},
"sparc:v8plus",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[3],
},
"sparc:v8plusa",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[4],
},
"sparc:sparclite_le",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[5],
},
"sparc:v9",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[6],
},
"sparc:v9a",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[7],
},
"sparc:v8plusb",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[8],
},
"sparc:v9b",
3,
false,
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
0,
}
"sparc",
3,
true, /* the default */
- sparc_compatible,
+ bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[0],
};