From 24a5e75166638126ae96b246f1a1cb673e4cddad Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 3 Jun 2001 02:41:58 +0000 Subject: [PATCH] 2001-06-02 H.J. Lu * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX and ELFOSABI_HPUX. * elf64-hppa.c (elf64_hppa_object_p): Likewise. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-hppa.c | 16 +++++++++++++++- bfd/elf64-hppa.c | 16 +++++++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e9a53c95f35..9e52c500265 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2001-06-02 H.J. Lu + + * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX + and ELFOSABI_HPUX. + * elf64-hppa.c (elf64_hppa_object_p): Likewise. + 2001-06-02 H.J. Lu * aout-cris.c (MACHTYPE_OK): New. Defined. diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 9f46a3d5805..c10df6bc811 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1147,8 +1147,22 @@ static boolean elf32_hppa_object_p (abfd) bfd *abfd; { - unsigned int flags = elf_elfheader (abfd)->e_flags; + Elf_Internal_Ehdr * i_ehdrp; + unsigned int flags; + + i_ehdrp = elf_elfheader (abfd); + if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0) + { + if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX) + return false; + } + else + { + if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX) + return false; + } + flags = i_ehdrp->e_flags; switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE)) { case EFA_PARISC_1_0: diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 1b3a548b72c..4a87358c9df 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -358,8 +358,22 @@ static boolean elf64_hppa_object_p (abfd) bfd *abfd; { - unsigned int flags = elf_elfheader (abfd)->e_flags; + Elf_Internal_Ehdr * i_ehdrp; + unsigned int flags; + + i_ehdrp = elf_elfheader (abfd); + if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0) + { + if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX) + return false; + } + else + { + if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX) + return false; + } + flags = i_ehdrp->e_flags; switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE)) { case EFA_PARISC_1_0: -- 2.30.2