From 80a903c960771293d31c60667f3af0253b0d6708 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 22 Apr 1994 17:11:37 +0000 Subject: [PATCH] * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of bfd_default_set_arch_mach. Accept bfd_arch_m68k as well as bfd_arch_unknown. * elfcode.h (elf_set_arch_mach): Don't check a list of ELF architectures, just see if the desired architecture matches what the ELF backend permits. --- bfd/ChangeLog | 13 +++++++++++++ bfd/elfcode.h | 24 ++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 96c14890a3e..c28df205c95 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,18 @@ Fri Apr 22 11:08:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of + bfd_default_set_arch_mach. Accept bfd_arch_m68k as well as + bfd_arch_unknown. + * coffcode.h (coff_set_arch_mach): Check return value of + bfd_default_set_arch_mach. + * elfcode.h (elf_set_arch_mach): Don't check a list of ELF + architectures, just see if the desired architecture matches what + the ELF backend permits. + + * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to + SH_ARCH_MAGIC to match change in coff/sh.h. + (coff_set_flags): Likewise. + Follow convention in which each NLM header has an 8 byte stamp followed by a four byte length. * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr diff --git a/bfd/elfcode.h b/bfd/elfcode.h index a93ac60f37f..ba9e456b883 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -3237,22 +3237,14 @@ elf_set_arch_mach (abfd, arch, machine) enum bfd_architecture arch; unsigned long machine; { - /* Allow any architecture to be supported by the elf backend */ - switch (arch) - { - case bfd_arch_unknown: /* EM_NONE */ - case bfd_arch_sparc: /* EM_SPARC */ - case bfd_arch_i386: /* EM_386 */ - case bfd_arch_m68k: /* EM_68K */ - case bfd_arch_m88k: /* EM_88K */ - case bfd_arch_i860: /* EM_860 */ - case bfd_arch_mips: /* EM_MIPS (MIPS R3000) */ - case bfd_arch_hppa: /* EM_HPPA (HP PA_RISC) */ - case bfd_arch_powerpc: /* EM_CYGNUS_POWERPC */ - return bfd_default_set_arch_mach (abfd, arch, machine); - default: - return false; - } + /* If this isn't the right architecture for this backend, and this + isn't the generic backend, fail. */ + if (arch != get_elf_backend_data (abfd)->arch + && arch != bfd_arch_unknown + && get_elf_backend_data (abfd)->arch != bfd_arch_unknown) + return false; + + return bfd_default_set_arch_mach (abfd, arch, machine); } boolean -- 2.30.2