This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Recognize elf64-i386 at least as elf64-little.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 31 Jul 2008 13:23:09 +0200
- Subject: [patch] Recognize elf64-i386 at least as elf64-little.
Hi,
Linux kernel kdump on x86 hosts with produces elf64-i386 files for >4GB memory
(PAE - Page Addressing Extension kernels).
Class: ELF64
Type: CORE (Core file)
Machine: Intel 80386
Currently:
objdump: /sdb1/vmcore: File format not recognized
The patch recognizes such elf64-i386 at least as elf64-little for `objdump -x'.
`objdump -D' still does not work there - I tried to create elf64-i386.c
#includeing and over#defineing elf32-i386.c but IMO it is not worth it.
(The patch fixes x86_64 hosts, for x86 I will post an AC_SYS_LARGEFILE patch.)
Regards,
Jan
2008-07-29 Jan Kratochvil <jan.kratochvil@redhat.com>
Recognize elf64-i386 at least as elf64-little.
* elfcore.h (elf_core_file_p): Exclusion of existing arches for the
generic arch fallback now matches also the arch size.
--- bfd/elfcore.h 10 May 2008 01:58:17 -0000 1.27
+++ bfd/elfcore.h 29 Jul 2008 18:25:07 -0000
@@ -159,11 +159,12 @@ elf_core_file_p (bfd *abfd)
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
back = xvec_get_elf_backend_data (*target_ptr);
- if (back->elf_machine_code == i_ehdrp->e_machine
- || (back->elf_machine_alt1 != 0
- && i_ehdrp->e_machine == back->elf_machine_alt1)
- || (back->elf_machine_alt2 != 0
- && i_ehdrp->e_machine == back->elf_machine_alt2))
+ if (ARCH_SIZE == back->s->arch_size
+ && (back->elf_machine_code == i_ehdrp->e_machine
+ || (back->elf_machine_alt1 != 0
+ && i_ehdrp->e_machine == back->elf_machine_alt1)
+ || (back->elf_machine_alt2 != 0
+ && i_ehdrp->e_machine == back->elf_machine_alt2)))
{
/* target_ptr is an ELF backend which matches this
object file, so reject the generic ELF target. */