summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-07-08 00:26:53 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-07-08 00:26:53 +0000
commit29ef70053f959e79ee068480e53ff9c490b891b3 (patch)
tree305742f500264efc76910b8740685998750653bb /bfd
parente7de25feb26c5598bf1082923fb33806dc93d002 (diff)
downloadbinutils-29ef70053f959e79ee068480e53ff9c490b891b3.tar.gz
binutils-29ef70053f959e79ee068480e53ff9c490b891b3.tar.bz2
binutils-29ef70053f959e79ee068480e53ff9c490b891b3.zip
2005-07-07 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_backend_data): Add special_sections. * elf.c (_bfd_elf_get_sec_type_attr): Check special_sections first. * 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_special_sections): New. (elfNN_bed): Initialize special_sections.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog27
-rw-r--r--bfd/elf-bfd.h3
-rw-r--r--bfd/elf.c14
-rw-r--r--bfd/elf32-arm.c22
-rw-r--r--bfd/elf32-m32r.c20
-rw-r--r--bfd/elf32-m68hc11.c20
-rw-r--r--bfd/elf32-m68hc12.c20
-rw-r--r--bfd/elf32-mcore.c20
-rw-r--r--bfd/elf32-sh64.c20
-rw-r--r--bfd/elf32-v850.c20
-rw-r--r--bfd/elf32-xtensa.c21
-rw-r--r--bfd/elf64-alpha.c22
-rw-r--r--bfd/elf64-hppa.c22
-rw-r--r--bfd/elf64-ppc.c20
-rw-r--r--bfd/elf64-sh64.c20
-rw-r--r--bfd/elfxx-ia64.c20
-rw-r--r--bfd/elfxx-mips.c18
-rw-r--r--bfd/elfxx-mips.h6
-rw-r--r--bfd/elfxx-target.h5
19 files changed, 67 insertions, 273 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 81e1c9d8530..e046fc3bfec 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,30 @@
+2005-07-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-bfd.h (elf_backend_data): Add special_sections.
+
+ * elf.c (_bfd_elf_get_sec_type_attr): Check special_sections
+ first.
+
+ * 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_special_sections): New.
+ (elfNN_bed): Initialize special_sections.
+
2005-07-07 Bob Wilson <bob.wilson@acm.org>
* xtensa-modules.c: Update tables with Xtensa MMU features.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 103b613354d..2bbc1c923de 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -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;
diff --git a/bfd/elf.c b/bfd/elf.c
index 130ec7a71d0..ff46a5e2ea9 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2339,15 +2339,27 @@ _bfd_elf_get_special_section (const char *name,
}
const struct bfd_elf_special_section *
-_bfd_elf_get_sec_type_attr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
+_bfd_elf_get_sec_type_attr (bfd *abfd, asection *sec)
{
int i;
const struct bfd_elf_special_section *spec;
+ 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);
+ spec = bed->special_sections;
+ if (spec)
+ {
+ spec = _bfd_elf_get_special_section (sec->name,
+ bed->special_sections,
+ sec->use_rela_p);
+ if (spec != NULL)
+ return spec;
+ }
+
if (sec->name[0] != '.')
return NULL;
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index db872fad14a..698571a5796 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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 (bfd *abfd,
#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 \
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index d29a7d3621c..4b148c83a0b 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -4020,24 +4020,6 @@ static const struct bfd_elf_special_section m32r_elf_special_sections[] =
{ 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_Internal_Rela *rela)
#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"
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index 34cdd9cb14e..d61590ff486 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -1265,24 +1265,6 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] =
{ ".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 *abfd, asection *sec)
#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
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index 34461b3d4dc..b52f3fff853 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -543,24 +543,6 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] =
{ ".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 *abfd, asection *sec)
#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
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 0a485942a1a..ed0123d553b 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -642,24 +642,6 @@ static const struct bfd_elf_special_section mcore_elf_special_sections[]=
{ 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, asection *sec)
#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
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index c140bf4d95c..afafcfde88d 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -89,7 +89,7 @@ static void sh64_find_section_for_address
#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_section sh64_elf_special_sections[] =
{ 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
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index ac7ac5e1b36..e2c29ee1922 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -3054,24 +3054,6 @@ static const struct bfd_elf_special_section v850_elf_special_sections[] =
+ 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, asection *sec)
#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
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index c97aea223a9..67ff80c4ef9 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -9489,25 +9489,6 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] =
{ ".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, asection *sec)
#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"
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index a04fe2166f7..2e09c6ed9b3 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -5169,24 +5169,6 @@ static const struct bfd_elf_special_section elf64_alpha_special_sections[] =
{ 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_elf_size_info =
#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
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 88b0bfed8b4..f0c87a04a56 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -2678,24 +2678,6 @@ static const struct bfd_elf_special_section elf64_hppa_special_sections[] =
{ 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_size_info =
#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_size_info =
#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"
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f05262b9c25..03b21e6253c 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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_section ppc64_elf_special_sections[]=
{ 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;
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 0bad2298dcf..22791eeebe3 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -4074,24 +4074,6 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]=
{ 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, asection *sec)
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
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index d016cf0fd3b..60ebd4f2307 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -5058,24 +5058,6 @@ static const struct bfd_elf_special_section elfNN_ia64_special_sections[] =
{ 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 (bfd *abfd ATTRIBUTE_UNUSED,
#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.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index d96400d15e3..d0791babc49 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9979,21 +9979,3 @@ const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] =
{ ".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);
-}
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index 2c63123bb25..ff53b0d8c53 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -127,10 +127,10 @@ extern bfd_boolean _bfd_mips_relax_section
(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
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 7a7f3e85022..cd63244033e 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -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 elfNN_bed =
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,