This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] check alternate machine codes when opening ELF core files


This patch fixes a problem where only the primary machine code for an ELF 
backend is checked when deciding whether to use the generic ELF backend for a 
core file.


2003-12-13  Bob Wilson  <bob.wilson@acm.org>

	* elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
	backends when checking if the generic ELF target should be used.

Index: elfcore.h
===================================================================
RCS file: /cvs/src/src/bfd/elfcore.h,v
retrieving revision 1.16
diff -c -3 -r1.16 elfcore.h
*** elfcore.h	30 Nov 2002 08:39:39 -0000	1.16
--- elfcore.h	12 Feb 2003 22:21:17 -0000
***************
*** 168,174 ****
  	  if ((*target_ptr)->flavour != bfd_target_elf_flavour)
  	    continue;
  	  back = (struct elf_backend_data *) (*target_ptr)->backend_data;
! 	  if (back->elf_machine_code == i_ehdrp->e_machine)
  	    {
  	      /* target_ptr is an ELF backend which matches this
  		 object file, so reject the generic ELF target.  */
--- 168,178 ----
  	  if ((*target_ptr)->flavour != bfd_target_elf_flavour)
  	    continue;
  	  back = (struct elf_backend_data *) (*target_ptr)->backend_data;
! 	  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))
  	    {
  	      /* target_ptr is an ELF backend which matches this
  		 object file, so reject the generic ELF target.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]