summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-08-01 12:21:28 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-08-01 12:21:28 +0000
commit9eab6109008c82a1280994713cf0745797a0c60f (patch)
tree52e39efd1f594c4d8d80b19871456739685fe3bd /bfd
parented04da3241757515b13582a930b060fb222cc4df (diff)
downloadgdb-9eab6109008c82a1280994713cf0745797a0c60f.tar.gz
* elfcore.h (elf_core_file_p): Ensure we have a backend match
with the correct arch size before rejecting the generic fallback. * elfcode.h (elf_object_p): Likewise. Ensure arch size matches before accepting a target.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elfcode.h4
-rw-r--r--bfd/elfcore.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 30b06335dbc..54da63c3e8d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,4 +1,12 @@
2008-08-01 Alan Modra <amodra@bigpond.net.au>
+ Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * elfcore.h (elf_core_file_p): Ensure we have a backend match
+ with the correct arch size before rejecting the generic fallback.
+ * elfcode.h (elf_object_p): Likewise. Ensure arch size matches
+ before accepting a target.
+
+2008-08-01 Alan Modra <amodra@bigpond.net.au>
* elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
include file or program headers.
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index c356638d088..b42229f007b 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -574,6 +574,8 @@ elf_object_p (bfd *abfd)
goto got_wrong_format_error;
ebd = get_elf_backend_data (abfd);
+ if (ebd->s->arch_size != ARCH_SIZE)
+ goto got_wrong_format_error;
/* Check that the ELF e_machine field matches what this particular
BFD format expects. */
@@ -595,6 +597,8 @@ elf_object_p (bfd *abfd)
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
back = xvec_get_elf_backend_data (*target_ptr);
+ if (back->s->arch_size != ARCH_SIZE)
+ continue;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
&& back->elf_machine_alt1 == i_ehdrp->e_machine)
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 9c51422624d..f9d578860ec 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -159,6 +159,8 @@ 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->s->arch_size != ARCH_SIZE)
+ continue;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
&& i_ehdrp->e_machine == back->elf_machine_alt1)