aboutsummaryrefslogtreecommitdiff
path: root/bfd/archures.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-04-20 02:54:26 +0000
committerAlan Modra <amodra@gmail.com>2002-04-20 02:54:26 +0000
commit99dc00929f1a580201609842f1d6ba9cbb6f91fd (patch)
tree2ab0ec5868b0ac8b5bfedbb24388e48d552af138 /bfd/archures.c
parent73d322b1b9870ab0d1842723e199f9ab995b4663 (diff)
downloadgdb-99dc00929f1a580201609842f1d6ba9cbb6f91fd.zip
gdb-99dc00929f1a580201609842f1d6ba9cbb6f91fd.tar.gz
gdb-99dc00929f1a580201609842f1d6ba9cbb6f91fd.tar.bz2
* archures.c (bfd_lookup_arch): Add comment on list order.
(bfd_default_set_arch_mach): Use bfd_lookup_arch. * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default is always at head of list.
Diffstat (limited to 'bfd/archures.c')
-rw-r--r--bfd/archures.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/bfd/archures.c b/bfd/archures.c
index 9a91424..4f6c90f 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -604,21 +604,9 @@ bfd_default_set_arch_mach (abfd, arch, mach)
enum bfd_architecture arch;
unsigned long mach;
{
- const bfd_arch_info_type * const *app, *ap;
-
- for (app = bfd_archures_list; *app != NULL; app++)
- {
- for (ap = *app; ap != NULL; ap = ap->next)
- {
- if (ap->arch == arch
- && (ap->mach == mach
- || (mach == 0 && ap->the_default)))
- {
- abfd->arch_info = ap;
- return true;
- }
- }
- }
+ abfd->arch_info = bfd_lookup_arch (arch, mach);
+ if (abfd->arch_info != NULL)
+ return true;
abfd->arch_info = &bfd_default_arch_struct;
bfd_set_error (bfd_error_bad_value);
@@ -985,7 +973,9 @@ DESCRIPTION
Look for the architecure info structure which matches the
arguments @var{arch} and @var{machine}. A machine of 0 matches the
machine/architecture structure which marks itself as the
- default.
+ default. gdb relies on the default arch being the first
+ entry for the given ARCH so that all the entries for that
+ arch can be accessed via ap->next.
*/
const bfd_arch_info_type *