diff options
author | Alan Modra <amodra@bigpond.net.au> | 2001-01-31 13:28:50 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2001-01-31 13:28:50 +0000 |
commit | caade57a596669b1d53c97246fa2b2da591fba47 (patch) | |
tree | 7bfcefcf2d90c294c21ce936e12cb449d08ecf95 /bfd/elf64-hppa.c | |
parent | 0da91883e6d0f516af2278636d276b3de7b46c31 (diff) | |
download | gdb-caade57a596669b1d53c97246fa2b2da591fba47.tar.gz |
(elf64_hppa_object_p): Set architecture and machine from elf header flags.
Diffstat (limited to 'bfd/elf64-hppa.c')
-rw-r--r-- | bfd/elf64-hppa.c | 17 |
1 files changed, 15 insertions, 2 deletions
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 |