Replace 'arch' field with 'mach'.

This commit is contained in:
Nick Clifton
2002-02-14 16:24:20 +00:00
parent dd47e6fdd9
commit e2fd756b5d
2 changed files with 47 additions and 40 deletions

View File

@ -1,3 +1,8 @@
2002-02-14 Nick Clifton <nickc@cambridge.redhat.com>
* cpu-arm.c (processors): Replace 'arch' field with 'mach'.
(scan): Test against 'mach' field in info structure.
2002-02-14 Alan Modra <amodra@bigpond.net.au> 2002-02-14 Alan Modra <amodra@bigpond.net.au>
* elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD. * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.

View File

@ -1,5 +1,5 @@
/* BFD support for the ARM processor /* BFD support for the ARM processor
Copyright 1994, 1997, 1999, 2000 Free Software Foundation, Inc. Copyright 1994, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -24,34 +24,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const bfd_arch_info_type * compatible static const bfd_arch_info_type * compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
static boolean scan PARAMS ((const struct bfd_arch_info *, const char *)); static boolean scan
PARAMS ((const struct bfd_arch_info *, const char *));
/* This routine is provided two arch_infos and works out which ARM /* This routine is provided two arch_infos and works out which ARM
machine which would be compatible with both and returns a pointer machine which would be compatible with both and returns a pointer
to its info structure */ to its info structure. */
static const bfd_arch_info_type * static const bfd_arch_info_type *
compatible (a,b) compatible (a,b)
const bfd_arch_info_type * a; const bfd_arch_info_type * a;
const bfd_arch_info_type * b; const bfd_arch_info_type * b;
{ {
/* If a & b are for different architecture we can do nothing */ /* If a & b are for different architecture we can do nothing. */
if (a->arch != b->arch) if (a->arch != b->arch)
return NULL; return NULL;
/* If a & b are for the same machine then all is well */ /* If a & b are for the same machine then all is well. */
if (a->mach == b->mach) if (a->mach == b->mach)
return a; return a;
/* Otherwise if either a or b is the 'default' machine then /* Otherwise if either a or b is the 'default' machine
it can be polymorphed into the other */ then it can be polymorphed into the other. */
if (a->the_default) if (a->the_default)
return b; return b;
if (b->the_default) if (b->the_default)
return a; return a;
/* So far all newer ARM architecture cores are supersets of previous cores */ /* So far all newer ARM architecture cores are
supersets of previous cores. */
if (a->mach < b->mach) if (a->mach < b->mach)
return b; return b;
else if (a->mach > b->mach) else if (a->mach > b->mach)
@ -63,7 +65,7 @@ compatible (a,b)
static struct static struct
{ {
enum bfd_architecture arch; unsigned int mach;
char * name; char * name;
} }
processors[] = processors[] =
@ -103,21 +105,21 @@ scan (info, string)
{ {
int i; int i;
/* First test for an exact match */ /* First test for an exact match. */
if (strcasecmp (string, info->printable_name) == 0) if (strcasecmp (string, info->printable_name) == 0)
return true; return true;
/* Next check for a processor name instead of an Architecture name */ /* Next check for a processor name instead of an Architecture name. */
for (i = sizeof (processors) / sizeof (processors[0]); i--;) for (i = sizeof (processors) / sizeof (processors[0]); i--;)
{ {
if (strcasecmp (string, processors [i].name) == 0) if (strcasecmp (string, processors [i].name) == 0)
break; break;
} }
if (i != -1 && info->arch == processors[ i ].arch) if (i != -1 && info->mach == processors [i].mach)
return true; return true;
/* Finally check for the default architecture */ /* Finally check for the default architecture. */
if (strcasecmp (string, "arm") == 0) if (strcasecmp (string, "arm") == 0)
return info->the_default; return info->the_default;