This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] properly recognize corefiles for hppa*-linux
- From: Randolph Chung <randolph at tausq dot org>
- To: binutils at sources dot redhat dot com
- Date: Sun, 17 Aug 2003 12:08:33 -0700
- Subject: [patch] properly recognize corefiles for hppa*-linux
- Reply-to: Randolph Chung <randolph at tausq dot org>
This patch has been living in Debian for some time.... basically, gcc on
hppa-linux produces objects with OSABI=Linux, but the Linux kernel
always produces corefiles with OSABI=SysV, so gdb was not properly
recognizing corefiles on hppa-linux. This patch changes bfd so it
accepts both types.
Pls apply; thanks
randolph
Index: bfd/ChangeLog
===================================================================
RCS file: /cvs/src/src/bfd/ChangeLog,v
retrieving revision 1.2228
diff -u -p -r1.2228 ChangeLog
--- bfd/ChangeLog 17 Aug 2003 07:37:33 -0000 1.2228
+++ bfd/ChangeLog 17 Aug 2003 18:59:28 -0000
@@ -1,3 +1,9 @@
+2003-08-17 Randolph Chung <tausq@debian.org>
+
+ * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects
+ can have OSABI=Linux or OSABI=SysV; check for both
+ * elf64-hppa.c (elf64_hppa_object_p): Likewise
+
2003-08-17 Hans-Peter Nilsson <hp@bitrange.com>
* simple.c (bfd_simple_get_relocated_section_contents): Move
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.102
diff -u -p -r1.102 elf32-hppa.c
--- bfd/elf32-hppa.c 7 Aug 2003 08:38:07 -0000 1.102
+++ bfd/elf32-hppa.c 17 Aug 2003 18:59:31 -0000
@@ -924,7 +924,10 @@ elf32_hppa_object_p (bfd *abfd)
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0)
{
- if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX)
+ /* gcc on hppa-linux produces binaries with OSABI=Linux,
+ but the kernel produces corefiles with OSABI=SysV */
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
+ i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
else
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.36
diff -u -p -r1.36 elf64-hppa.c
--- bfd/elf64-hppa.c 30 Jul 2003 02:15:07 -0000 1.36
+++ bfd/elf64-hppa.c 17 Aug 2003 18:59:33 -0000
@@ -380,7 +380,10 @@ elf64_hppa_object_p (abfd)
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
{
- if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX)
+ /* gcc on hppa-linux produces binaries with OSABI=Linux,
+ but the kernel produces corefiles with OSABI=SysV */
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
+ i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
else
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/