From: Alan Modra Date: Wed, 31 Jan 2001 13:28:50 +0000 (+0000) Subject: (elf64_hppa_object_p): Set architecture and machine from elf header flags. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9634ba1ffb3d4209a06fa5ad42feb3700da0bb5;p=binutils-gdb.git (elf64_hppa_object_p): Set architecture and machine from elf header flags. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e9b87105d20..6330a85c1d0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -2,6 +2,8 @@ * elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function. (elf_backend_get_symbol_type): Define. + (elf64_hppa_object_p): Set architecture and machine from elf + header flags. 2001-01-30 Curtis L. Janssen diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 7aa4e1864a5..1b3a548b72c 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -358,8 +358,21 @@ static boolean elf64_hppa_object_p (abfd) bfd *abfd; { - /* Set the right machine number for an HPPA ELF file. */ - return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25); + unsigned int flags = elf_elfheader (abfd)->e_flags; + + switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE)) + { + case EFA_PARISC_1_0: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 10); + case EFA_PARISC_1_1: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11); + case EFA_PARISC_2_0: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20); + case EFA_PARISC_2_0 | EF_PARISC_WIDE: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25); + } + /* Don't be fussy. */ + return true; } /* Given section type (hdr->sh_type), return a boolean indicating