* PATCH: Speed up get_special_section
@ 2005-05-06 23:07 H. J. Lu
2005-05-06 23:18 ` Eric Christopher
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: H. J. Lu @ 2005-05-06 23:07 UTC (permalink / raw)
To: binutils
get_special_section scans the whole array for a match. This patch
reduces the number of searches.
H.J.
----
2005-05-06 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_backend_data): Update special_sections to
array of pointer to bfd_elf_special_section.
* elf.c (special_sections): Likewise.
* elf32-arm.c (elf32_arm_symbian_special_sections): Likewise.
* elf32-m32r.c (m32r_elf_special_sections): Likewise.
* elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
* elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
* elf32-mcore.c (mcore_elf_special_sections): Likewise.
* elf32-ppc.c (ppc_elf_special_sections): Likewise.
* elf32-sh64.c (sh64_elf_special_sections): Likewise.
* elf32-v850.c (v850_elf_special_sections): Likewise.
* elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
* elf64-alpha.c (elf64_alpha_special_sections): Likewise.
* elf64-hppa.c (elf64_hppa_special_sections): Likewise.
* elf64-ppc.c (ppc64_elf_special_sections): Likewise.
* elf64-sh64.c (sh64_elf64_special_sections): Likewise.
* elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
* elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
* elfxx-mips.h (_bfd_mips_elf_special_sections): Likewise.
* elf.c (get_special_section): Updated.
--- bfd/elf-bfd.h.sec 2005-05-05 14:06:10.000000000 -0700
+++ bfd/elf-bfd.h 2005-05-05 14:10:03.000000000 -0700
@@ -976,8 +976,9 @@ struct elf_backend_data
const struct elf_size_info *s;
- /* An array of target specific special section map. */
- const struct bfd_elf_special_section *special_sections;
+ /* An array of 27 target specific special section map arrays,
+ covering 'a' to 'z', plus other. */
+ const struct bfd_elf_special_section **special_sections;
/* offset of the _GLOBAL_OFFSET_TABLE_ symbol from the start of the
.got section */
--- bfd/elf.c.sec 2005-05-05 10:52:50.000000000 -0700
+++ bfd/elf.c 2005-05-06 14:26:23.000000000 -0700
@@ -2117,25 +2117,23 @@ bfd_section_from_elf_index (bfd *abfd, u
return elf_elfsections (abfd)[index]->bfd_section;
}
-static struct bfd_elf_special_section const special_sections[] =
+static struct bfd_elf_special_section const special_sections_b[] =
{
{ ".bss", 4, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
- { ".gnu.linkonce.b",15, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_c[] =
+{
{ ".comment", 8, 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_d[] =
+{
{ ".data", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".data1", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".debug", 6, 0, SHT_PROGBITS, 0 },
- { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { ".line", 5, 0, SHT_PROGBITS, 0 },
- { ".rodata", 7, -2, SHT_PROGBITS, SHF_ALLOC },
- { ".rodata1", 8, 0, SHT_PROGBITS, SHF_ALLOC },
- { ".tbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
- { ".tdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
- { ".text", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE },
- { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE },
- { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
{ ".debug_line", 11, 0, SHT_PROGBITS, 0 },
{ ".debug_info", 11, 0, SHT_PROGBITS, 0 },
{ ".debug_abbrev", 13, 0, SHT_PROGBITS, 0 },
@@ -2143,33 +2141,143 @@ static struct bfd_elf_special_section co
{ ".dynamic", 8, 0, SHT_DYNAMIC, SHF_ALLOC },
{ ".dynstr", 7, 0, SHT_STRTAB, SHF_ALLOC },
{ ".dynsym", 7, 0, SHT_DYNSYM, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_f[] =
+{
+ { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_g[] =
+{
+ { ".gnu.linkonce.b",15, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".got", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { ".hash", 5, 0, SHT_HASH, SHF_ALLOC },
- { ".interp", 7, 0, SHT_PROGBITS, 0 },
- { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { ".shstrtab", 9, 0, SHT_STRTAB, 0 },
- { ".strtab", 7, 0, SHT_STRTAB, 0 },
- { ".symtab", 7, 0, SHT_SYMTAB, 0 },
{ ".gnu.version", 12, 0, SHT_GNU_versym, 0 },
{ ".gnu.version_d", 14, 0, SHT_GNU_verdef, 0 },
{ ".gnu.version_r", 14, 0, SHT_GNU_verneed, 0 },
+ { ".gnu.liblist", 12, 0, SHT_GNU_LIBLIST, SHF_ALLOC },
+ { ".gnu.conflict", 13, 0, SHT_RELA, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_h[] =
+{
+ { ".hash", 5, 0, SHT_HASH, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_i[] =
+{
+ { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE },
+ { ".interp", 7, 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_l[] =
+{
+ { ".line", 5, 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_n[] =
+{
{ ".note.GNU-stack",15, 0, SHT_PROGBITS, 0 },
{ ".note", 5, -1, SHT_NOTE, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_p[] =
+{
+ { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
+ { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_r[] =
+{
+ { ".rodata", 7, -2, SHT_PROGBITS, SHF_ALLOC },
+ { ".rodata1", 8, 0, SHT_PROGBITS, SHF_ALLOC },
{ ".rela", 5, -1, SHT_RELA, 0 },
{ ".rel", 4, -1, SHT_REL, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const special_sections_s[] =
+{
+ { ".shstrtab", 9, 0, SHT_STRTAB, 0 },
+ { ".strtab", 7, 0, SHT_STRTAB, 0 },
+ { ".symtab", 7, 0, SHT_SYMTAB, 0 },
{ ".stabstr", 5, 3, SHT_STRTAB, 0 },
- { ".gnu.liblist", 12, 0, SHT_GNU_LIBLIST, SHF_ALLOC },
- { ".gnu.conflict", 13, 0, SHT_RELA, SHF_ALLOC },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const special_sections_t[] =
+{
+ { ".text", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { ".tbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
+ { ".tdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *special_sections [27] =
+{
+ NULL, /* 'a' */
+ special_sections_b, /* 'b' */
+ special_sections_c, /* 'b' */
+ special_sections_d, /* 'd' */
+ NULL, /* 'e' */
+ special_sections_f, /* 'f' */
+ special_sections_g, /* 'g' */
+ special_sections_h, /* 'h' */
+ special_sections_i, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ special_sections_l, /* 'l' */
+ NULL, /* 'm' */
+ special_sections_n, /* 'n' */
+ NULL, /* 'o' */
+ special_sections_p, /* 'p' */
+ NULL, /* 'q' */
+ special_sections_r, /* 'r' */
+ special_sections_s, /* 's' */
+ special_sections_t, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
static const struct bfd_elf_special_section *
get_special_section (const char *name,
- const struct bfd_elf_special_section *special_sections,
+ const struct bfd_elf_special_section **special_sections_p,
unsigned int rela)
{
int i;
- int len = strlen (name);
+ int len;
+ const struct bfd_elf_special_section *special_sections;
+
+ if (name [0] == '.')
+ {
+ i = name [1] - 'a';
+ if (i < 0 || i > 25)
+ i = 26;
+ }
+ else
+ i = 26;
+
+ special_sections = special_sections_p [i];
+
+ if (!special_sections)
+ return special_sections;
+
+ len= strlen (name);
for (i = 0; special_sections[i].prefix != NULL; i++)
{
--- bfd/elf32-arm.c.sec 2005-05-05 07:44:34.000000000 -0700
+++ bfd/elf32-arm.c 2005-05-06 14:26:49.000000000 -0700
@@ -6538,8 +6538,8 @@ elf32_arm_symbian_link_hash_table_create
return ret;
}
-static struct bfd_elf_special_section const
- elf32_arm_symbian_special_sections[]=
+static struct bfd_elf_special_section const
+ symbian_special_sections_d[]=
{
/* In a BPABI executable, the dynamic linking sections do not go in
the loadable read-only segment. The post-linker may wish to
@@ -6548,17 +6548,93 @@ static struct bfd_elf_special_section co
{ ".dynamic", 8, 0, SHT_DYNAMIC, 0 },
{ ".dynstr", 7, 0, SHT_STRTAB, 0 },
{ ".dynsym", 7, 0, SHT_DYNSYM, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ symbian_special_sections_g[]=
+{
+ /* In a BPABI executable, the dynamic linking sections do not go in
+ the loadable read-only segment. The post-linker may wish to
+ refer to these sections, but they are not part of the final
+ program image. */
{ ".got", 4, 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ symbian_special_sections_h[]=
+{
+ /* In a BPABI executable, the dynamic linking sections do not go in
+ the loadable read-only segment. The post-linker may wish to
+ refer to these sections, but they are not part of the final
+ program image. */
{ ".hash", 5, 0, SHT_HASH, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ symbian_special_sections_i[]=
+{
/* These sections do not need to be writable as the SymbianOS
postlinker will arrange things so that no dynamic relocation is
required. */
{ ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ symbian_special_sections_f[]=
+{
+ /* These sections do not need to be writable as the SymbianOS
+ postlinker will arrange things so that no dynamic relocation is
+ required. */
{ ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ symbian_special_sections_p[]=
+{
+ /* These sections do not need to be writable as the SymbianOS
+ postlinker will arrange things so that no dynamic relocation is
+ required. */
{ ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const *
+ elf32_arm_symbian_special_sections[27]=
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ symbian_special_sections_d, /* 'd' */
+ NULL, /* 'e' */
+ symbian_special_sections_f, /* 'f' */
+ symbian_special_sections_g, /* 'g' */
+ symbian_special_sections_h, /* 'h' */
+ symbian_special_sections_i, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ symbian_special_sections_p, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ NULL, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
static void
elf32_arm_symbian_begin_write_processing (bfd *abfd,
struct bfd_link_info *link_info
--- bfd/elf32-m32r.c.sec 2005-05-05 07:44:37.000000000 -0700
+++ bfd/elf32-m32r.c 2005-05-06 14:27:41.000000000 -0700
@@ -4183,11 +4183,44 @@ m32r_elf_check_relocs (abfd, info, sec,
return TRUE;
}
-static struct bfd_elf_special_section const m32r_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ m32r_elf_special_sections_s[] =
{
{ ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ m32r_elf_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ m32r_elf_special_sections_s, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
};
static bfd_boolean
--- bfd/elf32-m68hc11.c.sec 2005-05-04 11:17:44.000000000 -0700
+++ bfd/elf32-m68hc11.c 2005-05-06 15:32:56.000000000 -0700
@@ -1257,14 +1257,65 @@ m68hc11_elf_relax_delete_bytes (bfd *abf
are located in .page0.
- The .vectors is the section that represents the interrupt
vectors. */
-static struct bfd_elf_special_section const elf32_m68hc11_special_sections[]=
+static struct bfd_elf_special_section const
+ m68hc11_special_sections_e[] =
{
{ ".eeprom", 7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ m68hc11_special_sections_s[]=
+{
{ ".softregs", 9, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ m68hc11_special_sections_p[]=
+{
{ ".page0", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ m68hc11_special_sections_v[]=
+{
{ ".vectors", 8, 0, SHT_PROGBITS, SHF_ALLOC },
{ NULL, 0, 0, 0, 0 }
};
+
+static struct bfd_elf_special_section const *
+ elf32_m68hc11_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ m68hc11_special_sections_e, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ m68hc11_special_sections_p, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ m68hc11_special_sections_s, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ m68hc11_special_sections_v, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
\f
#define ELF_ARCH bfd_arch_m68hc11
#define ELF_MACHINE_CODE EM_68HC11
--- bfd/elf32-m68hc12.c.sec 2005-05-04 11:17:44.000000000 -0700
+++ bfd/elf32-m68hc12.c 2005-05-06 15:32:26.000000000 -0700
@@ -535,14 +535,65 @@ m68hc12_elf_set_mach_from_flags (bfd *ab
Page0 accesses are faster on the M68HC12.
- The .vectors is the section that represents the interrupt
vectors. */
-static struct bfd_elf_special_section const elf32_m68hc12_special_sections[]=
+static struct bfd_elf_special_section const
+ m68hc12_special_sections_e[] =
{
{ ".eeprom", 7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ m68hc12_special_sections_s[]=
+{
{ ".softregs", 9, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ m68hc12_special_sections_p[]=
+{
{ ".page0", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ m68hc12_special_sections_v[]=
+{
{ ".vectors", 8, 0, SHT_PROGBITS, SHF_ALLOC },
{ NULL, 0, 0, 0, 0 }
};
+
+static struct bfd_elf_special_section const *
+ elf32_m68hc12_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ m68hc12_special_sections_e, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ m68hc12_special_sections_p, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ m68hc12_special_sections_s, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ m68hc12_special_sections_v, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
\f
#define ELF_ARCH bfd_arch_m68hc12
#define ELF_MACHINE_CODE EM_68HC12
--- bfd/elf32-mcore.c.sec 2005-05-04 11:17:44.000000000 -0700
+++ bfd/elf32-mcore.c 2005-05-06 15:33:29.000000000 -0700
@@ -662,13 +662,52 @@ mcore_elf_check_relocs (abfd, info, sec,
return TRUE;
}
-static struct bfd_elf_special_section const mcore_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ mcore_special_sections_c [] =
{
{ ".ctors", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ mcore_special_sections_d[]=
+{
{ ".dtors", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const *
+ mcore_elf_special_sections[27]=
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ mcore_special_sections_c, /* 'c' */
+ mcore_special_sections_d, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ NULL, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
#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
--- bfd/elf32-ppc.c.sec 2005-05-05 07:44:38.000000000 -0700
+++ bfd/elf32-ppc.c 2005-05-06 15:33:55.000000000 -0700
@@ -1736,18 +1736,69 @@ ppc_elf_additional_program_headers (bfd
that the linker doesn't crater when trying to make more than
2 sections. */
-static struct bfd_elf_special_section const ppc_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ ppc_special_sections_p[] =
+{
+ { ".plt", 4, 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ ppc_special_sections_s[] =
{
- { ".tags", 5, 0, SHT_ORDERED, SHF_ALLOC },
{ ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".sdata2", 7, -2, SHT_PROGBITS, SHF_ALLOC },
{ ".sbss2", 6, -2, SHT_PROGBITS, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ ppc_special_sections_t[] =
+{
+ { ".tags", 5, 0, SHT_ORDERED, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ ppc_special_sections_other[]=
+{
{ ".PPC.EMB.apuinfo", 16, 0, SHT_NOTE, 0 },
{ ".PPC.EMB.sdata0", 15, 0, SHT_PROGBITS, SHF_ALLOC },
{ ".PPC.EMB.sbss0", 14, 0, SHT_PROGBITS, SHF_ALLOC },
- { ".plt", 4, 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ ppc_elf_special_sections[27]=
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ ppc_special_sections_p, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ ppc_special_sections_s, /* 's' */
+ ppc_special_sections_t, /* 's' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ ppc_special_sections_other, /* other */
};
\f
/* Very simple linked list structure for recording apuinfo values. */
--- bfd/elf32-sh64.c.sec 2005-05-04 11:17:45.000000000 -0700
+++ bfd/elf32-sh64.c 2005-05-06 15:22:04.000000000 -0700
@@ -754,10 +754,43 @@ sh64_elf_merge_symbol_attribute (struct
return;
}
-static struct bfd_elf_special_section const sh64_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ sh64_special_sections_c[] =
{
{ ".cranges", 8, 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ sh64_elf_special_sections[27]=
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ sh64_special_sections_c, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ NULL, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
};
#undef TARGET_BIG_SYM
--- bfd/elf32-v850.c.sec 2005-05-04 11:17:45.000000000 -0700
+++ bfd/elf32-v850.c 2005-05-06 15:35:14.000000000 -0700
@@ -3121,35 +3121,92 @@ v850_elf_relax_section (abfd, sec, link_
goto finish;
}
-static struct bfd_elf_special_section const v850_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ v850_special_sections_c[]=
+{
+ { ".call_table_data", 16, 0, SHT_PROGBITS, (SHF_ALLOC
+ + SHF_WRITE) },
+ { ".call_table_text", 16, 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ + SHF_EXECINSTR) },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ v850_special_sections_r[]=
{
- { ".sdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
- + SHF_V850_GPREL) },
{ ".rosdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC
+ SHF_V850_GPREL) },
+ { ".rozdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC
+ + SHF_V850_R0REL) },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ v850_special_sections_s[]=
+{
+ { ".sdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ + SHF_V850_GPREL) },
{ ".sbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_GPREL) },
{ ".scommon", 8, -2, SHT_V850_SCOMMON, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_GPREL) },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ v850_special_sections_t[]=
+{
{ ".tdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_EPREL) },
{ ".tbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_EPREL) },
{ ".tcommon", 8, -2, SHT_V850_TCOMMON, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ v850_special_sections_z[]=
+{
{ ".zdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
- { ".rozdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC
- + SHF_V850_R0REL) },
{ ".zbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
{ ".zcommon", 8, -2, SHT_V850_ZCOMMON, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
- { ".call_table_data", 16, 0, SHT_PROGBITS, (SHF_ALLOC
- + SHF_WRITE) },
- { ".call_table_text", 16, 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
- + SHF_EXECINSTR) },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ v850_elf_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ v850_special_sections_c, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ v850_special_sections_r, /* 'r' */
+ v850_special_sections_s, /* 's' */
+ v850_special_sections_t, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ v850_special_sections_z, /* 'z' */
+ NULL /* other */
};
\f
#define TARGET_LITTLE_SYM bfd_elf32_v850_vec
--- bfd/elf32-xtensa.c.sec 2005-05-05 07:44:40.000000000 -0700
+++ bfd/elf32-xtensa.c 2005-05-06 15:05:26.000000000 -0700
@@ -9479,14 +9479,58 @@ xtensa_callback_required_dependence (bfd
/* The default literal sections should always be marked as "code" (i.e.,
SHF_EXECINSTR). This is particularly important for the Linux kernel
module loader so that the literals are not placed after the text. */
-static struct bfd_elf_special_section const elf_xtensa_special_sections[]=
+static struct bfd_elf_special_section const
+ xtensa_special_sections_f[]=
{
- { ".literal", 8, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { ".init.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ ".fini.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const
+ xtensa_special_sections_i[]=
+{
+ { ".init.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { NULL, 0, 0, 0, 0 }
+};
+static struct bfd_elf_special_section const
+ xtensa_special_sections_l[]=
+{
+ { ".literal", 8, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ elf_xtensa_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ xtensa_special_sections_f, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ xtensa_special_sections_i, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ xtensa_special_sections_l, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ NULL, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
\f
#ifndef ELF_ARCH
#define TARGET_LITTLE_SYM bfd_elf32_xtensa_le_vec
--- bfd/elf64-alpha.c.sec 2005-05-05 07:44:40.000000000 -0700
+++ bfd/elf64-alpha.c 2005-05-06 15:12:52.000000000 -0700
@@ -5370,13 +5370,46 @@ elf64_alpha_reloc_type_class (rela)
}
}
\f
-static struct bfd_elf_special_section const elf64_alpha_special_sections[]=
+static struct bfd_elf_special_section const
+ alpha_special_sections_s[]=
{
{ ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
{ ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const *
+ elf64_alpha_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ alpha_special_sections_s, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
/* ECOFF swapping routines. These are used when dealing with the
.mdebug section, which is in the ECOFF debugging format. Copied
from elf32-mips.c. */
--- bfd/elf64-hppa.c.sec 2005-05-05 07:44:40.000000000 -0700
+++ bfd/elf64-hppa.c 2005-05-06 15:21:31.000000000 -0700
@@ -2671,13 +2671,52 @@ elf64_hppa_elf_get_symbol_type (elf_sym,
return type;
}
-static struct bfd_elf_special_section const elf64_hppa_special_sections[]=
+static struct bfd_elf_special_section const
+ hppa_special_sections_f[]=
{
{ ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ hppa_special_sections_i[]=
+{
{ ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const *
+ elf64_hppa_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ hppa_special_sections_f, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ hppa_special_sections_i, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'f' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ NULL, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
/* The hash bucket size is the standard one, namely 4. */
const struct elf_size_info hppa64_elf_size_info =
--- bfd/elf64-ppc.c.sec 2005-05-05 07:44:41.000000000 -0700
+++ bfd/elf64-ppc.c 2005-05-06 15:30:51.000000000 -0700
@@ -2504,17 +2504,62 @@ ppc64_elf_merge_private_bfd_data (bfd *i
/* Add extra PPC sections. */
-static struct bfd_elf_special_section const ppc64_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ ppc64_special_sections_p[]=
+{
+ { ".plt", 4, 0, SHT_NOBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ ppc64_special_sections_s[]=
{
{ ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
- { ".plt", 4, 0, SHT_NOBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ ppc64_special_sections_t[]=
+{
{ ".toc", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".toc1", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".tocbss", 7, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ NULL, 0, 0, 0, 0 }
};
+static struct bfd_elf_special_section const *
+ ppc64_elf_special_sections[27]=
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ ppc64_special_sections_p, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ ppc64_special_sections_s, /* 's' */
+ ppc64_special_sections_t, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
+
struct _ppc64_elf_section_data
{
struct bfd_elf_section_data elf;
--- bfd/elf64-sh64.c.sec 2005-05-05 07:44:41.000000000 -0700
+++ bfd/elf64-sh64.c 2005-05-06 15:30:22.000000000 -0700
@@ -4063,10 +4063,43 @@ sh64_elf64_merge_symbol_attribute (struc
return;
}
-static struct bfd_elf_special_section const sh64_elf64_special_sections[]=
+static struct bfd_elf_special_section const
+ sh64_special_sections_c[] =
{
{ ".cranges", 8, 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ sh64_elf64_special_sections[27]=
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ sh64_special_sections_c, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ NULL, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
};
#define TARGET_BIG_SYM bfd_elf64_sh64_vec
--- bfd/elfxx-ia64.c.sec 2005-05-05 07:44:43.000000000 -0700
+++ bfd/elfxx-ia64.c 2005-05-06 15:23:34.000000000 -0700
@@ -4908,11 +4908,44 @@ elfNN_ia64_reloc_type_class (rela)
}
}
-static struct bfd_elf_special_section const elfNN_ia64_special_sections[]=
+static struct bfd_elf_special_section const
+ ia64_special_sections_s[]=
{
{ ".sbss", 5, -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
{ ".sdata", 6, -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const *
+ elfNN_ia64_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ NULL, /* 'l' */
+ NULL, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ ia64_special_sections_s, /* 's' */
+ NULL, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
};
static bfd_boolean
--- bfd/elfxx-mips.c.sec 2005-05-05 10:53:45.000000000 -0700
+++ bfd/elfxx-mips.c 2005-05-06 15:37:25.000000000 -0700
@@ -9926,13 +9926,63 @@ _bfd_mips_elf_print_private_bfd_data (bf
return TRUE;
}
-struct bfd_elf_special_section const _bfd_mips_elf_special_sections[]=
+static struct bfd_elf_special_section const
+ mips_special_sections_l[]=
{
- { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
- { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ ".lit4", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ ".lit8", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
- { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+static struct bfd_elf_special_section const
+ mips_special_sections_m[]=
+{
{ ".mdebug", 7, 0, SHT_MIPS_DEBUG, 0 },
{ NULL, 0, 0, 0, 0 }
};
+
+static struct bfd_elf_special_section const
+ mips_special_sections_s[]=
+{
+ { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
+ { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
+};
+
+static struct bfd_elf_special_section const
+ mips_special_sections_u[]=
+{
+ { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
+struct bfd_elf_special_section const *
+ _bfd_mips_elf_special_sections[27] =
+{
+ NULL, /* 'a' */
+ NULL, /* 'b' */
+ NULL, /* 'c' */
+ NULL, /* 'd' */
+ NULL, /* 'e' */
+ NULL, /* 'f' */
+ NULL, /* 'g' */
+ NULL, /* 'h' */
+ NULL, /* 'i' */
+ NULL, /* 'j' */
+ NULL, /* 'k' */
+ mips_special_sections_l, /* 'l' */
+ mips_special_sections_m, /* 'm' */
+ NULL, /* 'n' */
+ NULL, /* 'o' */
+ NULL, /* 'p' */
+ NULL, /* 'q' */
+ NULL, /* 'r' */
+ mips_special_sections_s, /* 'm' */
+ NULL, /* 't' */
+ mips_special_sections_u, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ NULL, /* 'z' */
+ NULL /* other */
+};
--- bfd/elfxx-mips.h.sec 2005-05-06 15:26:56.000000000 -0700
+++ bfd/elfxx-mips.h 2005-05-06 15:30:01.000000000 -0700
@@ -126,7 +126,7 @@ extern bfd_boolean _bfd_mips_relax_secti
extern bfd_vma _bfd_mips_elf_sign_extend
(bfd_vma, int);
-extern struct bfd_elf_special_section const _bfd_mips_elf_special_sections[];
+extern struct bfd_elf_special_section const *_bfd_mips_elf_special_sections[];
#define elf_backend_name_local_section_symbols \
_bfd_mips_elf_name_local_section_symbols
#define elf_backend_special_sections _bfd_mips_elf_special_sections
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-06 23:07 PATCH: Speed up get_special_section H. J. Lu
@ 2005-05-06 23:18 ` Eric Christopher
2005-05-06 23:20 ` H. J. Lu
2005-05-07 0:52 ` PATCH: Speed up get_special_section Alan Modra
2005-05-07 7:54 ` Nick Clifton
2 siblings, 1 reply; 10+ messages in thread
From: Eric Christopher @ 2005-05-06 23:18 UTC (permalink / raw)
To: H. J. Lu; +Cc: binutils
On Fri, 2005-05-06 at 15:53 -0700, H. J. Lu wrote:
> get_special_section scans the whole array for a match. This patch
> reduces the number of searches.
And you tested by... ? :)
-eric
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-06 23:18 ` Eric Christopher
@ 2005-05-06 23:20 ` H. J. Lu
2005-05-07 0:12 ` Eric Christopher
0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2005-05-06 23:20 UTC (permalink / raw)
To: Eric Christopher; +Cc: binutils
On Fri, May 06, 2005 at 04:07:25PM -0700, Eric Christopher wrote:
> On Fri, 2005-05-06 at 15:53 -0700, H. J. Lu wrote:
> > get_special_section scans the whole array for a match. This patch
> > reduces the number of searches.
>
> And you tested by... ? :)
>
I run profiling on sec64k.exp. Old:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
23.33 0.07 0.07 2014 0.03 0.03 subseg_set_rest
16.67 0.12 0.05 22050 0.00 0.00 hash_lookup
13.33 0.16 0.04 3012 0.01 0.01 get_special_section
New:
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
26.79 0.08 0.08 2014 0.04 0.04 subseg_set_rest
7.14 0.10 0.02 22050 0.00 0.00 hash_lookup
7.14 0.12 0.02 6 3.33 3.33 hash_new
...
0.00 0.30 0.00 3012 0.00 0.00 get_special_section
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-06 23:20 ` H. J. Lu
@ 2005-05-07 0:12 ` Eric Christopher
2005-05-07 0:34 ` H. J. Lu
0 siblings, 1 reply; 10+ messages in thread
From: Eric Christopher @ 2005-05-07 0:12 UTC (permalink / raw)
To: H. J. Lu; +Cc: binutils
On Fri, 2005-05-06 at 16:18 -0700, H. J. Lu wrote:
> On Fri, May 06, 2005 at 04:07:25PM -0700, Eric Christopher wrote:
> > On Fri, 2005-05-06 at 15:53 -0700, H. J. Lu wrote:
> > > get_special_section scans the whole array for a match. This patch
> > > reduces the number of searches.
> >
> > And you tested by... ? :)
> >
>
> I run profiling on sec64k.exp. Old:
Nice, I'd meant something like:
"--enable-targets=all and make check with no regressions" also :)
-eric
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-07 0:12 ` Eric Christopher
@ 2005-05-07 0:34 ` H. J. Lu
2005-05-07 0:50 ` PATCH: Fix d10v-dis.c for 64bit host H. J. Lu
0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2005-05-07 0:34 UTC (permalink / raw)
To: Eric Christopher; +Cc: binutils
On Fri, May 06, 2005 at 04:20:16PM -0700, Eric Christopher wrote:
> On Fri, 2005-05-06 at 16:18 -0700, H. J. Lu wrote:
> > On Fri, May 06, 2005 at 04:07:25PM -0700, Eric Christopher wrote:
> > > On Fri, 2005-05-06 at 15:53 -0700, H. J. Lu wrote:
> > > > get_special_section scans the whole array for a match. This patch
> > > > reduces the number of searches.
> > >
> > > And you tested by... ? :)
> > >
> >
> > I run profiling on sec64k.exp. Old:
>
> Nice, I'd meant something like:
>
> "--enable-targets=all and make check with no regressions" also :)
>
It won't build:
/net/gnu/export/gnu/src/binutils/binutils/opcodes/d10v-dis.c: In
function `dis_2_short':
/net/gnu/export/gnu/src/binutils/binutils/opcodes/d10v-dis.c:256:
warning: comparison between signed and unsigned
on Linux/x86_64. It works on ia32, ia64 and x86_64.
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* PATCH: Fix d10v-dis.c for 64bit host
2005-05-07 0:34 ` H. J. Lu
@ 2005-05-07 0:50 ` H. J. Lu
0 siblings, 0 replies; 10+ messages in thread
From: H. J. Lu @ 2005-05-07 0:50 UTC (permalink / raw)
To: Eric Christopher; +Cc: binutils
On Fri, May 06, 2005 at 05:30:49PM -0700, H. J. Lu wrote:
> On Fri, May 06, 2005 at 04:20:16PM -0700, Eric Christopher wrote:
> > On Fri, 2005-05-06 at 16:18 -0700, H. J. Lu wrote:
> > > On Fri, May 06, 2005 at 04:07:25PM -0700, Eric Christopher wrote:
> > > > On Fri, 2005-05-06 at 15:53 -0700, H. J. Lu wrote:
> > > > > get_special_section scans the whole array for a match. This patch
> > > > > reduces the number of searches.
> > > >
> > > > And you tested by... ? :)
> > > >
> > >
> > > I run profiling on sec64k.exp. Old:
> >
> > Nice, I'd meant something like:
> >
> > "--enable-targets=all and make check with no regressions" also :)
> >
>
> It won't build:
>
> /net/gnu/export/gnu/src/binutils/binutils/opcodes/d10v-dis.c: In
> function `dis_2_short':
> /net/gnu/export/gnu/src/binutils/binutils/opcodes/d10v-dis.c:256:
> warning: comparison between signed and unsigned
>
> on Linux/x86_64. It works on ia32, ia64 and x86_64.
>
>
With this patch, --enable-targets=all is OK on Linux/x86_64.
H.J.
----
2005-05-06 H.J. Lu <hongjiu.lu@intel.com>
* d10v-dis.c (dis_2_short): Support 64bit host.
--- opcodes/d10v-dis.c.int 2001-12-04 04:30:55.000000000 -0800
+++ opcodes/d10v-dis.c 2005-05-06 17:43:32.000000000 -0700
@@ -253,7 +253,8 @@ dis_2_short (insn, memaddr, info, order)
while (op->name)
{
if ((op->format & SHORT_OPCODE)
- && ((op->mask & ins[j]) == (unsigned long) op->opcode))
+ && ((((unsigned int) op->mask) & ins[j])
+ == (unsigned int) op->opcode))
{
(*info->fprintf_func) (info->stream, "%s\t", op->name);
for (i = 0; op->operands[i]; i++)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-06 23:07 PATCH: Speed up get_special_section H. J. Lu
2005-05-06 23:18 ` Eric Christopher
@ 2005-05-07 0:52 ` Alan Modra
2005-05-07 1:01 ` H. J. Lu
2005-05-07 7:54 ` Nick Clifton
2 siblings, 1 reply; 10+ messages in thread
From: Alan Modra @ 2005-05-07 0:52 UTC (permalink / raw)
To: H. J. Lu; +Cc: binutils
On Fri, May 06, 2005 at 03:53:50PM -0700, H. J. Lu wrote:
> get_special_section scans the whole array for a match. This patch
> reduces the number of searches.
Have you abandoned your idea of not calling get_special_section on
sections loaded from an input file? (Or did the profiling results
shown include that optimization as well? It's a little too good to
be true.)
--
Alan Modra
IBM OzLabs - Linux Technology Centre
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-07 0:52 ` PATCH: Speed up get_special_section Alan Modra
@ 2005-05-07 1:01 ` H. J. Lu
2005-05-07 2:03 ` Alan Modra
0 siblings, 1 reply; 10+ messages in thread
From: H. J. Lu @ 2005-05-07 1:01 UTC (permalink / raw)
To: binutils
On Sat, May 07, 2005 at 10:20:17AM +0930, Alan Modra wrote:
> On Fri, May 06, 2005 at 03:53:50PM -0700, H. J. Lu wrote:
> > get_special_section scans the whole array for a match. This patch
> > reduces the number of searches.
>
> Have you abandoned your idea of not calling get_special_section on
> sections loaded from an input file? (Or did the profiling results
> shown include that optimization as well? It's a little too good to
> be true.)
The profiling data came from assembler in 64K section tests.
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-07 1:01 ` H. J. Lu
@ 2005-05-07 2:03 ` Alan Modra
0 siblings, 0 replies; 10+ messages in thread
From: Alan Modra @ 2005-05-07 2:03 UTC (permalink / raw)
To: H. J. Lu; +Cc: binutils
On Fri, May 06, 2005 at 05:52:44PM -0700, H. J. Lu wrote:
> The profiling data came from assembler in 64K section tests.
Silly me. I could have seen that if I looked at the function names.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: PATCH: Speed up get_special_section
2005-05-06 23:07 PATCH: Speed up get_special_section H. J. Lu
2005-05-06 23:18 ` Eric Christopher
2005-05-07 0:52 ` PATCH: Speed up get_special_section Alan Modra
@ 2005-05-07 7:54 ` Nick Clifton
2 siblings, 0 replies; 10+ messages in thread
From: Nick Clifton @ 2005-05-07 7:54 UTC (permalink / raw)
To: H. J. Lu; +Cc: binutils
Hi H. J.
> H.J.
> ----
> 2005-05-06 H.J. Lu <hongjiu.lu@intel.com>
>
> * elf-bfd.h (elf_backend_data): Update special_sections to
> array of pointer to bfd_elf_special_section.
> * elf.c (special_sections): Likewise.
> * elf32-arm.c (elf32_arm_symbian_special_sections): Likewise.
> * elf32-m32r.c (m32r_elf_special_sections): Likewise.
> * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
> * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
> * elf32-mcore.c (mcore_elf_special_sections): Likewise.
> * elf32-ppc.c (ppc_elf_special_sections): Likewise.
> * elf32-sh64.c (sh64_elf_special_sections): Likewise.
> * elf32-v850.c (v850_elf_special_sections): Likewise.
> * elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
> * elf64-alpha.c (elf64_alpha_special_sections): Likewise.
> * elf64-hppa.c (elf64_hppa_special_sections): Likewise.
> * elf64-ppc.c (ppc64_elf_special_sections): Likewise.
> * elf64-sh64.c (sh64_elf64_special_sections): Likewise.
> * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
> * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
> * elfxx-mips.h (_bfd_mips_elf_special_sections): Likewise.
>
> * elf.c (get_special_section): Updated.
Approved - please apply (with the additional patch to d10v-dis.c).
Cheers
Nick
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-05-07 7:51 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-06 23:07 PATCH: Speed up get_special_section H. J. Lu
2005-05-06 23:18 ` Eric Christopher
2005-05-06 23:20 ` H. J. Lu
2005-05-07 0:12 ` Eric Christopher
2005-05-07 0:34 ` H. J. Lu
2005-05-07 0:50 ` PATCH: Fix d10v-dis.c for 64bit host H. J. Lu
2005-05-07 0:52 ` PATCH: Speed up get_special_section Alan Modra
2005-05-07 1:01 ` H. J. Lu
2005-05-07 2:03 ` Alan Modra
2005-05-07 7:54 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).