This is the mail archive of the binutils@sourceware.org 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: Use xvec_get_elf_backend_data


This patch uses xvec_get_elf_backend_data in elfcode.h and elfcore.h.


H.J.
----
2007-08-03  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (xvec_get_elf_backend_data): Add const.

	* elfcode.h (elf_object_p): Use xvec_get_elf_backend_data.
	* elfcore.h (elf_core_file_p): Likewise.

--- bfd/elf-bfd.h.xvec	2007-08-02 19:51:33.000000000 -0700
+++ bfd/elf-bfd.h	2007-08-03 09:20:35.000000000 -0700
@@ -1244,7 +1244,7 @@ struct bfd_elf_section_data
 #define elf_sec_group(sec)	(elf_section_data(sec)->sec_group)
 
 #define xvec_get_elf_backend_data(xvec) \
-  ((struct elf_backend_data *) (xvec)->backend_data)
+  ((const struct elf_backend_data *) (xvec)->backend_data)
 
 #define get_elf_backend_data(abfd) \
    xvec_get_elf_backend_data ((abfd)->xvec)
--- bfd/elfcode.h.xvec	2007-07-24 15:03:49.000000000 -0700
+++ bfd/elfcode.h	2007-08-03 09:22:11.000000000 -0700
@@ -605,7 +605,7 @@ elf_object_p (bfd *abfd)
 
 	  if ((*target_ptr)->flavour != bfd_target_elf_flavour)
 	    continue;
-	  back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
+	  back = xvec_get_elf_backend_data (*target_ptr);
 	  if (back->elf_machine_code == i_ehdrp->e_machine
 	      || (back->elf_machine_alt1 != 0
 		  && back->elf_machine_alt1 == i_ehdrp->e_machine)
@@ -658,7 +658,7 @@ elf_object_p (bfd *abfd)
 		  != target->header_byteorder))
 	    continue;
 
-	  back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
+	  back = xvec_get_elf_backend_data (*target_ptr);
 	  if (back->elf_osabi == i_ehdrp->e_ident[EI_OSABI]
 	      && (back->elf_machine_code == i_ehdrp->e_machine
 		  || (back->elf_machine_alt1 != 0
--- bfd/elfcore.h.xvec	2007-08-02 17:50:33.000000000 -0700
+++ bfd/elfcore.h	2007-08-03 09:23:07.000000000 -0700
@@ -158,7 +158,7 @@ elf_core_file_p (bfd *abfd)
 
 	  if ((*target_ptr)->flavour != bfd_target_elf_flavour)
 	    continue;
-	  back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
+	  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)


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