* 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.
This commit is contained in:
Alan Modra 2002-03-13 07:30:45 +00:00
parent fa7ea4d864
commit b74fa2cd15
6 changed files with 31 additions and 73 deletions

View File

@ -1,5 +1,12 @@
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.

View File

@ -722,6 +722,9 @@ bfd_default_compatible (a, b)
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;

View File

@ -91,7 +91,7 @@ compatible (in, out)
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;

View File

@ -24,27 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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 ... */
@ -58,7 +37,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"i370:360",
3,
false, /* not the default */
i370_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[1]
},
@ -72,7 +51,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"i370:370",
3,
false, /* not the default */
i370_compatible,
bfd_default_compatible,
bfd_default_scan,
0
},
@ -89,7 +68,7 @@ const bfd_arch_info_type bfd_i370_arch =
"i370:common",
3,
true, /* the default */
i370_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[0]
};

View File

@ -22,22 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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 */
@ -49,7 +33,7 @@ const bfd_arch_info_type bfd_i386_arch_intel_syntax =
"i386:intel",
3,
true,
i386_compatible,
bfd_default_compatible,
bfd_default_scan ,
0,
};
@ -64,7 +48,7 @@ const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
"x86-64:intel",
3,
true,
i386_compatible,
bfd_default_compatible,
bfd_default_scan ,
&bfd_i386_arch_intel_syntax,
};
@ -79,7 +63,7 @@ static const bfd_arch_info_type i8086_arch =
"i8086",
3,
false,
i386_compatible,
bfd_default_compatible,
bfd_default_scan ,
&bfd_x86_64_arch_intel_syntax,
};
@ -95,7 +79,7 @@ const bfd_arch_info_type bfd_x86_64_arch =
"x86-64",
3,
true,
i386_compatible,
bfd_default_compatible,
bfd_default_scan ,
&i8086_arch,
};
@ -111,7 +95,7 @@ const bfd_arch_info_type bfd_i386_arch =
"i386",
3,
true,
i386_compatible,
bfd_default_compatible,
bfd_default_scan ,
&bfd_x86_64_arch
};

View File

@ -1,5 +1,6 @@
/* 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.
@ -21,22 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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[] =
{
{
@ -49,7 +34,7 @@ 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],
},
@ -63,7 +48,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:sparclite",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[2],
},
@ -77,7 +62,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v8plus",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[3],
},
@ -91,7 +76,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v8plusa",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[4],
},
@ -105,7 +90,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:sparclite_le",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[5],
},
@ -119,7 +104,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v9",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[6],
},
@ -133,7 +118,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v9a",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[7],
},
@ -147,7 +132,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v8plusb",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[8],
},
@ -161,7 +146,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc:v9b",
3,
false,
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
0,
}
@ -178,7 +163,7 @@ const bfd_arch_info_type bfd_sparc_arch =
"sparc",
3,
true, /* the default */
sparc_compatible,
bfd_default_compatible,
bfd_default_scan,
&arch_info_struct[0],
};