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: Remove duplicated backend get_sec_type_attr


All of backend get_sec_type_attr functions are the same, except for
ppc. This patch removes those duplicated ones.


H.J.
----
2005-07-06  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (elf_backend_data): Add special_sections.
	(_bfd_elf_generic_get_sec_type_attr): New.

	* elf.c (_bfd_elf_generic_get_sec_type_attr): New.

	* elf32-arm.c (elf_backend_get_sec_type_attr): Removed.
	(elf_backend_special_sections): New. Defined.
	* elf32-m32r.c: Likewise.
	* elf32-m68hc11.c: Likewise.
	* elf32-m68hc12.c: Likewise.
	* elf32-mcore.c: Likewise.
	* elf32-sh64.c: Likewise.
	* elf32-v850.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-mips.h: Likewise.

	* elfxx-target.h (elf_backend_get_sec_type_attr): Default
	to _bfd_elf_generic_get_sec_type_attr.
	(elf_backend_special_sections): New.
	(elfNN_bed): Initialize special_sections.

	* elf32-ppc.c (elf_backend_special_sections): Added.

--- bfd/elf-bfd.h.special	2005-07-06 08:45:37.160285272 -0700
+++ bfd/elf-bfd.h	2005-07-06 09:48:44.427972050 -0700
@@ -981,6 +981,9 @@ struct elf_backend_data
 
   const struct elf_size_info *s;
 
+  /* An array of target specific special sections.  */
+  const struct bfd_elf_special_section *special_sections;
+
   /* The size in bytes of the header for the GOT.  This includes the
      so-called reserved entries on some systems.  */
   bfd_vma got_header_size;
@@ -1506,6 +1509,8 @@ extern const struct bfd_elf_special_sect
   (const char *, const struct bfd_elf_special_section *, unsigned int);
 extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr
   (bfd *, asection *);
+extern const struct bfd_elf_special_section *_bfd_elf_generic_get_sec_type_attr
+  (bfd *, asection *);
 
 /* If the target doesn't have reloc handling written yet:  */
 extern void _bfd_elf_no_info_to_howto
--- bfd/elf.c.special	2005-07-06 08:45:37.369250775 -0700
+++ bfd/elf.c	2005-07-06 09:58:08.979901433 -0700
@@ -2363,6 +2363,30 @@ _bfd_elf_get_sec_type_attr (bfd *abfd AT
   return _bfd_elf_get_special_section (sec->name, spec, sec->use_rela_p);
 }
 
+const struct bfd_elf_special_section *
+_bfd_elf_generic_get_sec_type_attr (bfd *abfd, asection *sec)
+{
+  const struct bfd_elf_special_section *ssect;
+  const struct elf_backend_data *bed;
+
+  /* See if this is one of the special sections.  */
+  if (sec->name == NULL)
+    return NULL;
+
+  bed = get_elf_backend_data (abfd);
+  ssect = bed->special_sections;
+  if (ssect)
+    {
+      ssect = _bfd_elf_get_special_section (sec->name,
+					    bed->special_sections,
+					    sec->use_rela_p);
+      if (ssect != NULL)
+	return ssect;
+    }
+
+  return _bfd_elf_get_sec_type_attr (abfd, sec);
+}
+
 bfd_boolean
 _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
 {
--- bfd/elf32-arm.c.special	2005-07-06 08:45:37.517226348 -0700
+++ bfd/elf32-arm.c	2005-07-06 09:59:25.536280540 -0700
@@ -6962,24 +6962,6 @@ elf32_arm_symbian_special_sections[] =
   { NULL,              0,  0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-elf32_arm_symbian_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elf32_arm_symbian_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 static void
 elf32_arm_symbian_begin_write_processing (bfd *abfd, 
 					  struct bfd_link_info *link_info
@@ -7032,8 +7014,8 @@ elf32_arm_symbian_modify_segment_map (bf
 #define bfd_elf32_bfd_link_hash_table_create \
   elf32_arm_symbian_link_hash_table_create
 
-#undef elf_backend_get_sec_type_attr
-#define elf_backend_get_sec_type_attr elf32_arm_symbian_get_sec_type_attr
+#undef elf_backend_special_sections
+#define elf_backend_special_sections elf32_arm_symbian_special_sections
 
 #undef elf_backend_begin_write_processing
 #define elf_backend_begin_write_processing \
--- bfd/elf32-m32r.c.special	2005-07-06 08:45:37.780182938 -0700
+++ bfd/elf32-m32r.c	2005-07-06 09:59:29.914558748 -0700
@@ -4020,24 +4020,6 @@ static const struct bfd_elf_special_sect
   { NULL,       0,  0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-m32r_elf_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					m32r_elf_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 static bfd_boolean
 m32r_elf_fake_sections (bfd *abfd,
 			Elf_Internal_Shdr *hdr ATTRIBUTE_UNUSED,
@@ -4141,7 +4123,7 @@ m32r_elf_reloc_type_class (const Elf_Int
 #define bfd_elf32_bfd_merge_private_bfd_data 	m32r_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags		m32r_elf_set_private_flags
 #define bfd_elf32_bfd_print_private_bfd_data	m32r_elf_print_private_bfd_data
-#define elf_backend_get_sec_type_attr		m32r_elf_get_sec_type_attr
+#define elf_backend_special_sections		m32r_elf_special_sections
 
 #include "elf32-target.h"
 
--- bfd/elf32-m68hc11.c.special	2005-07-06 08:45:37.808178317 -0700
+++ bfd/elf32-m68hc11.c	2005-07-06 09:59:34.254843220 -0700
@@ -1265,24 +1265,6 @@ static const struct bfd_elf_special_sect
   { ".vectors",  8, 0, SHT_PROGBITS, SHF_ALLOC },
   { NULL,        0, 0, 0,            0 }
 };
-
-static const struct bfd_elf_special_section *
-elf32_m68hc11_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elf32_m68hc11_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
 
 #define ELF_ARCH		bfd_arch_m68hc11
 #define ELF_MACHINE_CODE	EM_68HC11
@@ -1302,7 +1284,7 @@ elf32_m68hc11_get_sec_type_attr (bfd *ab
 #define elf_backend_object_p	0
 #define elf_backend_final_write_processing	0
 #define elf_backend_can_gc_sections		1
-#define elf_backend_get_sec_type_attr elf32_m68hc11_get_sec_type_attr
+#define elf_backend_special_sections  elf32_m68hc11_special_sections
 
 #define bfd_elf32_bfd_link_hash_table_create \
                                 m68hc11_elf_bfd_link_hash_table_create
--- bfd/elf32-m68hc12.c.special	2005-07-06 08:45:37.817176831 -0700
+++ bfd/elf32-m68hc12.c	2005-07-06 09:59:47.279695975 -0700
@@ -543,24 +543,6 @@ static const struct bfd_elf_special_sect
   { ".vectors",  8, 0, SHT_PROGBITS, SHF_ALLOC },
   { NULL,        0, 0, 0,            0 }
 };
-
-static const struct bfd_elf_special_section *
-elf32_m68hc12_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elf32_m68hc12_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
 
 #define ELF_ARCH		bfd_arch_m68hc12
 #define ELF_MACHINE_CODE	EM_68HC12
@@ -578,7 +560,7 @@ elf32_m68hc12_get_sec_type_attr (bfd *ab
 #define elf_backend_object_p		m68hc12_elf_set_mach_from_flags
 #define elf_backend_final_write_processing	0
 #define elf_backend_can_gc_sections		1
-#define elf_backend_get_sec_type_attr elf32_m68hc12_get_sec_type_attr
+#define elf_backend_special_sections elf32_m68hc12_special_sections
 #define elf_backend_post_process_headers     elf32_m68hc11_post_process_headers
 #define elf_backend_add_symbol_hook  elf32_m68hc11_add_symbol_hook
 
--- bfd/elf32-mcore.c.special	2005-07-06 08:45:37.827175181 -0700
+++ bfd/elf32-mcore.c	2005-07-06 09:59:55.072411287 -0700
@@ -642,24 +642,6 @@ static const struct bfd_elf_special_sect
   { NULL,       0,  0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-mcore_elf_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					mcore_elf_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 #define TARGET_BIG_SYM		bfd_elf32_mcore_big_vec
 #define TARGET_BIG_NAME		"elf32-mcore-big"
 #define TARGET_LITTLE_SYM       bfd_elf32_mcore_little_vec
@@ -678,7 +660,7 @@ mcore_elf_get_sec_type_attr (bfd *abfd, 
 #define elf_backend_gc_mark_hook		mcore_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook		mcore_elf_gc_sweep_hook
 #define elf_backend_check_relocs                mcore_elf_check_relocs
-#define elf_backend_get_sec_type_attr		mcore_elf_get_sec_type_attr
+#define elf_backend_special_sections		mcore_elf_special_sections
 
 #define elf_backend_can_gc_sections		1
 #define elf_backend_rela_normal			1
--- bfd/elf32-ppc.c.special	2005-07-06 08:45:38.059136889 -0700
+++ bfd/elf32-ppc.c	2005-07-06 11:16:25.403367099 -0700
@@ -7373,6 +7373,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou
 #define elf_backend_begin_write_processing	ppc_elf_begin_write_processing
 #define elf_backend_final_write_processing	ppc_elf_final_write_processing
 #define elf_backend_write_section		ppc_elf_write_section
+#define elf_backend_special_sections		ppc_elf_special_sections
 #define elf_backend_get_sec_type_attr		ppc_elf_get_sec_type_attr
 #define elf_backend_plt_sym_val			ppc_elf_plt_sym_val
 
@@ -7489,6 +7490,7 @@ ppc_elf_vxworks_final_write_processing (
 #undef elf_backend_final_write_processing
 #define elf_backend_final_write_processing \
   ppc_elf_vxworks_final_write_processing
+#undef elf_backend_special_sections
 #undef elf_backend_get_sec_type_attr
 #define elf_backend_get_sec_type_attr \
   ppc_elf_vxworks_get_sec_type_attr
--- bfd/elf32-sh64.c.special	2005-07-06 08:45:38.191115101 -0700
+++ bfd/elf32-sh64.c	2005-07-06 11:17:09.091171196 -0700
@@ -89,7 +89,7 @@ static void sh64_find_section_for_addres
 #define elf_backend_merge_symbol_attribute	sh64_elf_merge_symbol_attribute
 #define elf_backend_final_write_processing 	sh64_elf_final_write_processing
 #define elf_backend_section_from_shdr		sh64_backend_section_from_shdr
-#define elf_backend_get_sec_type_attr		sh64_elf_get_sec_type_attr
+#define elf_backend_special_sections		sh64_elf_special_sections
 #define elf_backend_section_flags		sh64_elf_section_flags
 
 #define bfd_elf32_new_section_hook		sh64_elf_new_section_hook
@@ -760,24 +760,6 @@ static const struct bfd_elf_special_sect
   { NULL,       0, 0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-sh64_elf_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					sh64_elf_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 #undef	TARGET_BIG_SYM
 #define	TARGET_BIG_SYM		bfd_elf32_sh64_vec
 #undef	TARGET_BIG_NAME
--- bfd/elf32-v850.c.special	2005-07-06 08:45:38.350088858 -0700
+++ bfd/elf32-v850.c	2005-07-06 11:13:36.814135758 -0700
@@ -3054,24 +3054,6 @@ static const struct bfd_elf_special_sect
                                                    + SHF_V850_R0REL) },
   { NULL,        0, 0, 0,            0 }
 };
-
-static const struct bfd_elf_special_section *
-v850_elf_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					v850_elf_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
 
 #define TARGET_LITTLE_SYM			bfd_elf32_v850_vec
 #define TARGET_LITTLE_NAME			"elf32-v850"
@@ -3096,7 +3078,7 @@ v850_elf_get_sec_type_attr (bfd *abfd, a
 #define elf_backend_fake_sections		v850_elf_fake_sections
 #define elf_backend_gc_mark_hook                v850_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook               v850_elf_gc_sweep_hook
-#define elf_backend_get_sec_type_attr		v850_elf_get_sec_type_attr
+#define elf_backend_special_sections		v850_elf_special_sections
 
 #define elf_backend_can_gc_sections 1
 #define elf_backend_rela_normal 1
--- bfd/elf32-xtensa.c.special	2005-07-06 08:45:38.642040662 -0700
+++ bfd/elf32-xtensa.c	2005-07-06 11:13:42.581185856 -0700
@@ -9489,25 +9489,6 @@ static const struct bfd_elf_special_sect
   { ".literal",       8, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
   { NULL,             0, 0, 0,            0 }
 };
-
-static const struct bfd_elf_special_section *
-elf_xtensa_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elf_xtensa_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 
 #ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM		bfd_elf32_xtensa_le_vec
@@ -9566,6 +9547,6 @@ elf_xtensa_get_sec_type_attr (bfd *abfd,
 #define elf_backend_reloc_type_class	     elf_xtensa_reloc_type_class
 #define elf_backend_relocate_section	     elf_xtensa_relocate_section
 #define elf_backend_size_dynamic_sections    elf_xtensa_size_dynamic_sections
-#define elf_backend_get_sec_type_attr	     elf_xtensa_get_sec_type_attr
+#define elf_backend_special_sections	     elf_xtensa_special_sections
 
 #include "elf32-target.h"
--- bfd/elf64-alpha.c.special	2005-07-06 08:45:38.878001710 -0700
+++ bfd/elf64-alpha.c	2005-07-06 11:13:47.081444610 -0700
@@ -5169,24 +5169,6 @@ static const struct bfd_elf_special_sect
   { NULL,     0,  0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-elf64_alpha_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elf64_alpha_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 /* ECOFF swapping routines.  These are used when dealing with the
    .mdebug section, which is in the ECOFF debugging format.  Copied
    from elf32-mips.c.  */
@@ -5325,8 +5307,8 @@ static const struct elf_size_info alpha_
 #define elf_backend_size_info \
   alpha_elf_size_info
 
-#define elf_backend_get_sec_type_attr \
-  elf64_alpha_get_sec_type_attr
+#define elf_backend_special_sections \
+  elf64_alpha_special_sections
 
 /* A few constants that determine how the .plt section is set up.  */
 #define elf_backend_want_got_plt 0
--- bfd/elf64-hppa.c.special	2005-07-06 08:45:38.980984709 -0700
+++ bfd/elf64-hppa.c	2005-07-06 11:14:38.567964165 -0700
@@ -2678,24 +2678,6 @@ static const struct bfd_elf_special_sect
   { NULL,       0, 0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-elf64_hppa_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elf64_hppa_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 /* The hash bucket size is the standard one, namely 4.  */
 
 const struct elf_size_info hppa64_elf_size_info =
@@ -2792,7 +2774,7 @@ const struct elf_size_info hppa64_elf_si
 #define elf_backend_get_symbol_type	elf64_hppa_elf_get_symbol_type
 #define elf_backend_reloc_type_class	elf64_hppa_reloc_type_class
 #define elf_backend_rela_normal		1
-#define elf_backend_get_sec_type_attr	elf64_hppa_get_sec_type_attr
+#define elf_backend_special_sections	elf64_hppa_special_sections
 
 #include "elf64-target.h"
 
@@ -2801,7 +2783,7 @@ const struct elf_size_info hppa64_elf_si
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME			"elf64-hppa-linux"
 
-#undef elf_backend_get_sec_type_attr
+#undef elf_backend_special_sections
 
 #define INCLUDED_TARGET_FILE 1
 #include "elf64-target.h"
--- bfd/elf64-ppc.c.special	2005-07-06 08:45:39.307930737 -0700
+++ bfd/elf64-ppc.c	2005-07-06 11:14:42.935244822 -0700
@@ -100,7 +100,7 @@ static bfd_vma opd_entry_value
 #define elf_backend_reloc_type_class	      ppc64_elf_reloc_type_class
 #define elf_backend_finish_dynamic_sections   ppc64_elf_finish_dynamic_sections
 #define elf_backend_link_output_symbol_hook   ppc64_elf_output_symbol_hook
-#define elf_backend_get_sec_type_attr	      ppc64_elf_get_sec_type_attr
+#define elf_backend_special_sections	      ppc64_elf_special_sections
 
 /* The name of the dynamic interpreter.  This is put in the .interp
    section.  */
@@ -2524,24 +2524,6 @@ static const struct bfd_elf_special_sect
   { NULL,       0,  0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-ppc64_elf_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					ppc64_elf_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 struct _ppc64_elf_section_data
 {
   struct bfd_elf_section_data elf;
--- bfd/elf64-sh64.c.special	2005-07-06 08:45:39.509897396 -0700
+++ bfd/elf64-sh64.c	2005-07-06 11:14:47.466498470 -0700
@@ -4074,24 +4074,6 @@ static const struct bfd_elf_special_sect
   { NULL,       0, 0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-sh64_elf64_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					sh64_elf64_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 #define TARGET_BIG_SYM		bfd_elf64_sh64_vec
 #define TARGET_BIG_NAME		"elf64-sh64"
 #define TARGET_LITTLE_SYM	bfd_elf64_sh64l_vec
@@ -4150,7 +4132,7 @@ sh64_elf64_get_sec_type_attr (bfd *abfd,
 					sh64_elf64_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_sections \
 					sh64_elf64_finish_dynamic_sections
-#define elf_backend_get_sec_type_attr	sh64_elf64_get_sec_type_attr
+#define elf_backend_special_sections	sh64_elf64_special_sections
 
 #define elf_backend_want_got_plt	1
 #define elf_backend_plt_readonly	1
--- bfd/elfxx-ia64.c.special	2005-07-06 08:45:39.764855307 -0700
+++ bfd/elfxx-ia64.c	2005-07-06 11:14:52.591654296 -0700
@@ -5058,24 +5058,6 @@ static const struct bfd_elf_special_sect
   { NULL,        0, 0, 0,            0 }
 };
 
-static const struct bfd_elf_special_section *
-elfNN_ia64_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					elfNN_ia64_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
-
 static bfd_boolean
 elfNN_ia64_object_p (bfd *abfd)
 {
@@ -5297,7 +5279,7 @@ elfNN_hpux_backend_symbol_processing (bf
 #define elf_backend_hide_symbol		elfNN_ia64_hash_hide_symbol
 #define elf_backend_reloc_type_class	elfNN_ia64_reloc_type_class
 #define elf_backend_rela_normal		1
-#define elf_backend_get_sec_type_attr	elfNN_ia64_get_sec_type_attr
+#define elf_backend_special_sections	elfNN_ia64_special_sections
 
 /* FIXME: PR 290: The Intel C compiler generates SHT_IA_64_UNWIND with
    SHF_LINK_ORDER. But it doesn't set theh sh_link or sh_info fields.
--- bfd/elfxx-mips.c.special	2005-07-06 08:45:40.127795393 -0700
+++ bfd/elfxx-mips.c	2005-07-06 09:44:10.056204293 -0700
@@ -9979,21 +9979,3 @@ const struct bfd_elf_special_section _bf
   { ".ucode",  6,  0, SHT_MIPS_UCODE, 0 },
   { NULL,      0,  0, 0,              0 }
 };
-
-const struct bfd_elf_special_section *
-_bfd_mips_elf_get_sec_type_attr (bfd *abfd, asection *sec)
-{
-  const struct bfd_elf_special_section *ssect;
-
-  /* See if this is one of the special sections.  */
-  if (sec->name == NULL)
-    return NULL;
-
-  ssect = _bfd_elf_get_special_section (sec->name,
-					_bfd_mips_elf_special_sections,
-					sec->use_rela_p);
-  if (ssect != NULL)
-    return ssect;
-
-  return _bfd_elf_get_sec_type_attr (abfd, sec);
-}
--- bfd/elfxx-mips.h.special	2005-07-06 08:45:40.144792587 -0700
+++ bfd/elfxx-mips.h	2005-07-06 11:24:56.709148931 -0700
@@ -127,10 +127,10 @@ extern bfd_boolean _bfd_mips_relax_secti
   (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
 extern bfd_vma _bfd_mips_elf_sign_extend
   (bfd_vma, int);
-extern const struct bfd_elf_special_section *_bfd_mips_elf_get_sec_type_attr
-  (bfd *, asection *);
+
+extern const struct bfd_elf_special_section _bfd_mips_elf_special_sections [];
 
 #define elf_backend_name_local_section_symbols \
   _bfd_mips_elf_name_local_section_symbols
-#define elf_backend_get_sec_type_attr _bfd_mips_elf_get_sec_type_attr
+#define elf_backend_special_sections _bfd_mips_elf_special_sections
 #define elf_backend_eh_frame_address_size _bfd_mips_elf_eh_frame_address_size
--- bfd/elfxx-target.h.special	2005-07-06 08:45:40.323763042 -0700
+++ bfd/elfxx-target.h	2005-07-06 09:58:45.083949410 -0700
@@ -332,7 +332,7 @@
 #define elf_backend_section_flags	0
 #endif
 #ifndef elf_backend_get_sec_type_attr
-#define elf_backend_get_sec_type_attr	_bfd_elf_get_sec_type_attr
+#define elf_backend_get_sec_type_attr	_bfd_elf_generic_get_sec_type_attr
 #endif
 #ifndef elf_backend_section_from_phdr
 #define elf_backend_section_from_phdr	_bfd_elf_make_section_from_phdr
@@ -509,6 +509,10 @@
 #define elf_backend_size_info _bfd_elfNN_size_info
 #endif
 
+#ifndef elf_backend_special_sections
+#define elf_backend_special_sections NULL
+#endif
+
 #ifndef elf_backend_sign_extend_vma
 #define elf_backend_sign_extend_vma 0
 #endif
@@ -591,6 +595,7 @@ static const struct elf_backend_data elf
   ELF_MACHINE_ALT1,
   ELF_MACHINE_ALT2,
   &elf_backend_size_info,
+  elf_backend_special_sections,
   elf_backend_got_header_size,
   elf_backend_collect,
   elf_backend_type_change_ok,


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