aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-01-31 13:28:50 +0000
committerAlan Modra <amodra@gmail.com>2001-01-31 13:28:50 +0000
commitd9634ba1ffb3d4209a06fa5ad42feb3700da0bb5 (patch)
treea8a35de48d1f2ca53013b2eb78a29658bc7af89b /bfd
parent956eedd4dc39168a5841975ee0fbf2da8301559f (diff)
downloadgdb-d9634ba1ffb3d4209a06fa5ad42feb3700da0bb5.zip
gdb-d9634ba1ffb3d4209a06fa5ad42feb3700da0bb5.tar.gz
gdb-d9634ba1ffb3d4209a06fa5ad42feb3700da0bb5.tar.bz2
(elf64_hppa_object_p): Set architecture and machine from elf header flags.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog2
-rw-r--r--bfd/elf64-hppa.c17
2 files changed, 17 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e9b8710..6330a85 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 <cljanss@ca.sandia.gov>
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 7aa4e18..1b3a548 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