summaryrefslogtreecommitdiffstats
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-08-01 12:21:28 +0000
committerAlan Modra <amodra@gmail.com>2008-08-01 12:21:28 +0000
commit11a7ae4fa9621fe4a90b201bd56f100bf4c736b6 (patch)
treecee1e431e1daa8346ce70ee650b6264088164c73 /bfd/elfcode.h
parent010c8431b082740e5156b9623ba9495fc0dd1c52 (diff)
downloadppe42-binutils-11a7ae4fa9621fe4a90b201bd56f100bf4c736b6.tar.gz
ppe42-binutils-11a7ae4fa9621fe4a90b201bd56f100bf4c736b6.zip
* 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/elfcode.h')
-rw-r--r--bfd/elfcode.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index c356638d08..b42229f007 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)
OpenPOWER on IntegriCloud