* elf-bfd.h (struct bfd_elf_special_section): Remove "suffix". Change
authorAlan Modra <amodra@gmail.com>
Tue, 23 Sep 2003 00:40:49 +0000 (00:40 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 23 Sep 2003 00:40:49 +0000 (00:40 +0000)
type of prefix_length and suffix_length to int.  Rename "attributes"
to "attr".  Comment.
(_bfd_elf_get_sec_type_attr): Update prototype.
* elf.c (get_special_section): Rewrite.
(_bfd_elf_get_sec_type_attr): Return struct rather than passing in
attr and type pointers.
(_bfd_elf_new_section_hook): Adjust for above.
(special_sections): Merge suffix with prefix.  Set
prefix_length for all entries.  Set suffix_length appropriately.
* 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-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.
* elf32-ppc.c (ppc_elf_special_sections): Likewise.  Fix .plt flags.

17 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf.c
bfd/elf32-m32r.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc12.c
bfd/elf32-mcore.c
bfd/elf32-ppc.c
bfd/elf32-sh64.c
bfd/elf32-v850.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-ppc.c
bfd/elf64-sh64.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c

index 9452f98352d183a5d3d89c6b6958ca454049598c..bffa6ec0cf77c838618a1ae4779e35ede3aefb39 100644 (file)
@@ -1,3 +1,30 @@
+2003-09-23  Alan Modra  <alan@modra.org>
+
+       * elf-bfd.h (struct bfd_elf_special_section): Remove "suffix".  Change
+       type of prefix_length and suffix_length to int.  Rename "attributes"
+       to "attr".  Comment.
+       (_bfd_elf_get_sec_type_attr): Update prototype.
+       * elf.c (get_special_section): Rewrite.
+       (_bfd_elf_get_sec_type_attr): Return struct rather than passing in
+       attr and type pointers.
+       (_bfd_elf_new_section_hook): Adjust for above.
+       (special_sections): Merge suffix with prefix.  Set
+       prefix_length for all entries.  Set suffix_length appropriately.
+       * 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-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.
+       * elf32-ppc.c (ppc_elf_special_sections): Likewise.  Fix .plt flags.
+
 2003-09-21  Daniel Jacobowitz  <drow@mvista.com>
 
        * elf64-alpha.c (elf64_alpha_create_got_section): Initialize
index abbe377e491dd6bd8d8f9aa9e04902e1c300933d..99036949adf5f6973543b708fb6a3b79f6527375 100644 (file)
@@ -511,11 +511,16 @@ typedef enum {
 struct bfd_elf_special_section
 {
   const char *prefix;
-  size_t prefix_length;
-  const char *suffix;
-  size_t suffix_length;
+  int prefix_length;
+  /* 0 means name must match PREFIX exactly.
+     -1 means name must start with PREFIX followed by an arbitrary string.
+     -2 means name must match PREFIX exactly or consist of PREFIX followed
+     by a dot then anything.
+     > 0 means name must start with the first PREFIX_LENGTH chars of
+     PREFIX and finish with the last SUFFIX_LENGTH chars of PREFIX.  */
+  int suffix_length;
   int type;
-  int attributes;
+  int attr;
 };
 
 struct elf_backend_data
@@ -1384,8 +1389,8 @@ extern bfd_boolean _bfd_elf_new_section_hook
   (bfd *, asection *);
 extern bfd_boolean _bfd_elf_init_reloc_shdr
   (bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean);
-extern bfd_boolean _bfd_elf_get_sec_type_attr
-  (bfd *, const char *, int *, int *);
+extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr
+  (bfd *, const char *);
 
 /* If the target doesn't have reloc handling written yet:  */
 extern void _bfd_elf_no_info_to_howto
index 5935803f11c279e4580c867e9a03aedbe5381b4a..5fde379d147162dc218b28290e31c93d82d95405 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2019,82 +2019,44 @@ bfd_section_from_elf_index (bfd *abfd, unsigned int index)
 
 static struct bfd_elf_special_section const special_sections[] =
 {
-  { ".bss",            0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE },
-  { ".comment",                0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".data",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".data1",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".debug",          0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".fini",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { ".init",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { ".line",           0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".rodata",         0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { ".rodata1",                0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { ".tbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_TLS },
-  { ".tdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_TLS },
-  { ".text",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { ".init_array",     0,      NULL,   0,
-    SHT_INIT_ARRAY,    SHF_ALLOC + SHF_WRITE },
-  { ".fini_array",     0,      NULL,   0,
-    SHT_FINI_ARRAY,    SHF_ALLOC + SHF_WRITE },
-  { ".preinit_array",  0,      NULL,   0,
-    SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
-  { ".debug_line",     0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".debug_info",     0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".debug_abbrev",   0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".debug_aranges",  0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".dynamic",                0,      NULL,   0,
-    SHT_DYNAMIC,       SHF_ALLOC },
-  { ".dynstr",         0,      NULL,   0,
-    SHT_STRTAB,                SHF_ALLOC },
-  { ".dynsym",         0,      NULL,   0,
-    SHT_DYNSYM,                SHF_ALLOC },
-  { ".got",            0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".hash",           0,      NULL,   0,
-    SHT_HASH,          SHF_ALLOC },
-  { ".interp",         0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { ".plt",            0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { ".shstrtab",       0,      NULL,   0,
-    SHT_STRTAB,                0 },
-  { ".strtab",         0,      NULL,   0,
-    SHT_STRTAB,                0 },
-  { ".symtab",         0,      NULL,   0,
-    SHT_SYMTAB,                0 },
-  { ".gnu.version",    0,      NULL,   0,
-    SHT_GNU_versym,    0 },
-  { ".gnu.version_d",  0,      NULL,   0,
-    SHT_GNU_verdef,    0 },
-  { ".gnu.version_r",  0,      NULL,   0,
-    SHT_GNU_verneed,   0 },
-  { ".note",           5,      NULL,   0,
-    SHT_NOTE,          0 },
-  { ".rela",           5,      NULL,   0,
-    SHT_RELA,          0 },
-  { ".rel",            4,      NULL,   0,
-    SHT_REL,           0 },
-  { ".stab",           5,      "str",  3,
-    SHT_STRTAB,                0 },
-  { NULL,              0,      NULL,   0,
-    0,          0 }
+  { ".bss",            4, -2, SHT_NOBITS,   SHF_ALLOC + SHF_WRITE },
+  { ".comment",        8,  0, SHT_PROGBITS, 0 },
+  { ".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 },
+  { ".debug_aranges", 14,  0, SHT_PROGBITS, 0 },
+  { ".dynamic",        8,  0, SHT_DYNAMIC,  SHF_ALLOC },
+  { ".dynstr",         7,  0, SHT_STRTAB,   SHF_ALLOC },
+  { ".dynsym",         7,  0, SHT_DYNSYM,   SHF_ALLOC },
+  { ".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 },
+  { ".note",           5, -1, SHT_NOTE,     0 },
+  { ".rela",           5, -1, SHT_RELA,     0 },
+  { ".rel",            4, -1, SHT_REL,      0 },
+  { ".stabstr",        5,  3, SHT_STRTAB,   0 },
+  { NULL,              0,  0, 0,            0 }
 };
 
 static const struct bfd_elf_special_section *
@@ -2103,32 +2065,55 @@ get_special_section (const char *name,
                     unsigned int rela)
 {
   int i;
+  int len = strlen (name);
 
   for (i = 0; special_sections[i].prefix != NULL; i++)
-    if (((special_sections[i].prefix_length
-         && strncmp (name, special_sections[i].prefix,
-                     special_sections[i].prefix_length) == 0
-         && (! special_sections[i].suffix_length
-             || strcmp ((name + strlen (name)
-                         - special_sections[i].suffix_length),
-                        special_sections[i].suffix) == 0))
-        || strcmp (name, special_sections[i].prefix) == 0)
-       && (rela || special_sections[i].type != SHT_RELA))
+    {
+      int suffix_len;
+      int prefix_len = special_sections[i].prefix_length;
+
+      if (len < prefix_len)
+       continue;
+      if (memcmp (name, special_sections[i].prefix, prefix_len) != 0)
+       continue;
+
+      suffix_len = special_sections[i].suffix_length;
+      if (suffix_len <= 0)
+       {
+         if (name[prefix_len] != 0)
+           {
+             if (suffix_len == 0)
+               continue;
+             if (name[prefix_len] != '.'
+                 && (suffix_len == -2
+                     || (rela && special_sections[i].type == SHT_REL)))
+               continue;
+           }
+       }
+      else
+       {
+         if (len < prefix_len + suffix_len)
+           continue;
+         if (memcmp (name + len - suffix_len,
+                     special_sections[i].prefix + prefix_len,
+                     suffix_len) != 0)
+           continue;
+       }
       return &special_sections[i];
+    }
 
   return NULL;
 }
 
-bfd_boolean
-_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name, int *type, int *attr)
+const struct bfd_elf_special_section *
+_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name)
 {
-  bfd_boolean found = FALSE;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  const struct bfd_elf_special_section *ssect = NULL;
 
   /* See if this is one of the special sections.  */
   if (name)
     {
-      const struct bfd_elf_special_section *ssect = NULL;
       unsigned int rela = bed->default_use_rela_p;
 
       if (bed->special_sections)
@@ -2136,23 +2121,16 @@ _bfd_elf_get_sec_type_attr (bfd *abfd, const char *name, int *type, int *attr)
 
       if (! ssect)
        ssect = get_special_section (name, special_sections, rela);
-
-      if (ssect)
-       {
-         *type = ssect->type;
-         *attr = ssect->attributes;
-         found = TRUE;
-       }
     }
 
-  return found;
+  return ssect;
 }
 
 bfd_boolean
 _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
 {
   struct bfd_elf_section_data *sdata;
-  int type, attr;
+  const struct bfd_elf_special_section *ssect;
 
   sdata = (struct bfd_elf_section_data *) sec->used_by_bfd;
   if (sdata == NULL)
@@ -2164,11 +2142,11 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
     }
 
   elf_section_type (sec) = SHT_NULL;
-  if (sec->name && _bfd_elf_get_sec_type_attr (abfd, sec->name,
-                                              &type, &attr))
+  ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name);
+  if (ssect != NULL)
     {
-      elf_section_type (sec) = type;
-      elf_section_flags (sec) = attr;
+      elf_section_type (sec) = ssect->type;
+      elf_section_flags (sec) = ssect->attr;
     }
 
   /* Indicate whether or not this section should use RELA relocations.  */
index 7e955e9b1168df931319f98334da32be9f948236..257a68cc7d5148de2c0e7f58427aa337963c0709 100644 (file)
@@ -2094,12 +2094,9 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
 
 static struct bfd_elf_special_section const m32r_elf_special_sections[]=
 {
-  { ".sdata",  0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".sbss",   0,      NULL,   0,
-    SHT_NOBITS,        SHF_ALLOC + SHF_WRITE },
-  { NULL,      0,      NULL,   0,
-    0,         0 }
+  { ".sdata",   6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".sbss",    5, -2, SHT_NOBITS,   SHF_ALLOC + SHF_WRITE },
+  { NULL,       0,  0, 0,            0 }
 };
 \f
 #define ELF_ARCH               bfd_arch_m32r
index 2844b487a401aa270d1af8f5e8d31d6ce2ec9287..49dcb6cef2f1e2f0c5c5139851599d2db15a4dd7 100644 (file)
@@ -1289,16 +1289,11 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
      vectors.  */
 static struct bfd_elf_special_section const elf32_m68hc11_special_sections[]=
 {
-  { ".eeprom",         0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".softregs",       0,      NULL,   0,
-    SHT_NOBITS,        SHF_ALLOC + SHF_WRITE },
-  { ".page0",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".vectors",                0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".eeprom",   7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".softregs", 9, 0, SHT_NOBITS,   SHF_ALLOC + SHF_WRITE },
+  { ".page0",    6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".vectors",  8, 0, SHT_PROGBITS, SHF_ALLOC },
+  { NULL,        0, 0, 0,            0 }
 };
 \f
 #define ELF_ARCH               bfd_arch_m68hc11
index 3074935cc83f1ff1cb116d534ac4f1d69df7f6f3..435c4bd9ac2eba1a84c90cea89e289846cfd8e0a 100644 (file)
@@ -545,16 +545,11 @@ m68hc12_elf_set_mach_from_flags (abfd)
      vectors.  */
 static struct bfd_elf_special_section const elf32_m68hc12_special_sections[]=
 {
-  { ".eeprom",         0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".softregs",       0,      NULL,   0,
-    SHT_NOBITS,        SHF_ALLOC + SHF_WRITE },
-  { ".page0",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".vectors",                0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".eeprom",   7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".softregs", 9, 0, SHT_NOBITS,   SHF_ALLOC + SHF_WRITE },
+  { ".page0",    6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".vectors",  8, 0, SHT_PROGBITS, SHF_ALLOC },
+  { NULL,        0, 0, 0,            0 }
 };
 \f
 #define ELF_ARCH               bfd_arch_m68hc12
index 3f878cfaca93f54d6c03751cf76cf823ce025329..59c5840d45ad1683c98fc3f25a764797407e8ef2 100644 (file)
@@ -683,12 +683,9 @@ mcore_elf_check_relocs (abfd, info, sec, relocs)
 
 static struct bfd_elf_special_section const mcore_elf_special_sections[]=
 {
-  { ".ctors",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".dtors",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".ctors",   6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".dtors",   6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { NULL,       0,  0, 0,            0 }
 };
 
 #define TARGET_BIG_SYM         bfd_elf32_mcore_big_vec
index 3bffc70c7868575cba5f1f2a84b753047f8d6130..a37eb3a284ad8598a46ffbbf12824c13531daff2 100644 (file)
@@ -6186,26 +6186,16 @@ ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
 
 static struct bfd_elf_special_section const ppc_elf_special_sections[]=
 {
-  { ".tags",           0,      NULL,   0,
-    SHT_ORDERED,       SHF_ALLOC },
-  { ".sdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".sbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE },
-  { ".sdata2",         0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { ".sbss2",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { ".PPC.EMB.apuinfo",        0,      NULL,   0,
-    SHT_NOTE,          0 },
-  { ".PPC.EMB.sdata0", 0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { ".PPC.EMB.sbss0",  0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC },
-  { ".plt",            0,      NULL,   0,
-    SHT_NOBITS,                0 },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".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 },
+  { ".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 }
 };
 \f
 #define TARGET_LITTLE_SYM      bfd_elf32_powerpcle_vec
index 396fedfad432a5fd922968840b7bfc875863ddcb..288003e0660410b911ace44f7e30cc00d969bbfd 100644 (file)
@@ -737,10 +737,8 @@ sh64_elf_final_write_processing (bfd *abfd,
 
 static struct bfd_elf_special_section const sh64_elf_special_sections[]=
 {
-  { ".cranges",                0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".cranges", 8, 0, SHT_PROGBITS, 0 },
+  { NULL,       0, 0, 0,            0 }
 };
 
 #undef TARGET_BIG_SYM
index 0dc6542b2d64d3f674e203de5b4d33e8c6e7f1b5..e2b80126f970ed4a3566f5c8a3ddf030fb0353d3 100644 (file)
@@ -3163,34 +3163,33 @@ v850_elf_relax_section (abfd, sec, link_info, again)
 
 static struct bfd_elf_special_section const v850_elf_special_sections[]=
 {
-  { ".sdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL },
-  { ".rosdata",                0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_V850_GPREL },
-  { ".sbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL },
-  { ".scommon",                0,      NULL,   0,
-    SHT_V850_SCOMMON,  SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL },
-  { ".tdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL },
-  { ".tbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL },
-  { ".tcommon",                0,      NULL,   0,
-    SHT_V850_TCOMMON,  SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
-  { ".zdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
-  { ".rozdata",                0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_V850_R0REL },
-  { ".zbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
-  { ".zcommon",                0,      NULL,   0,
-    SHT_V850_ZCOMMON,  SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
-  { ".call_table_data",        0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".call_table_text",        0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".sdata",            6, -2, SHT_PROGBITS,     (SHF_ALLOC + SHF_WRITE
+                                                   + SHF_V850_GPREL) },
+  { ".rosdata",          8, -2, SHT_PROGBITS,     (SHF_ALLOC
+                                                   + 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) },
+  { ".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) },
+  { ".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 }
 };
 \f
 #define TARGET_LITTLE_SYM                      bfd_elf32_v850_vec
index 251c33239594cdaf4e85cf43c1b04ec852b2c3dd..c9fce980db03196fc0abe019aa7bde06e3d348fb 100644 (file)
@@ -5841,14 +5841,10 @@ xtensa_callback_required_dependence (abfd, sec, link_info, callback, closure)
    module loader so that the literals are not placed after the text.  */
 static struct bfd_elf_special_section const elf_xtensa_special_sections[]=
 {
-  { ".literal",                0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { ".init.literal",   0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { ".fini.literal",   0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_EXECINSTR },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".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 }
 };
 
 \f
index a3f81ebac1bb99732673ae511b943143707f7505..7b1592daa7f2dcd096dab7b8691e96372d9c287f 100644 (file)
@@ -5449,12 +5449,9 @@ elf64_alpha_reloc_type_class (rela)
 \f
 static struct bfd_elf_special_section const elf64_alpha_special_sections[]=
 {
-  { ".sdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
-  { ".sbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".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 }
 };
 
 /* ECOFF swapping routines.  These are used when dealing with the
index 88403f5221cf52d0ef88e9b3226582665ede5f4c..9eced4c9cc60db1670d8354ab39ec2862681b58b 100644 (file)
@@ -2675,12 +2675,9 @@ elf64_hppa_elf_get_symbol_type (elf_sym, type)
 
 static struct bfd_elf_special_section const elf64_hppa_special_sections[]=
 {
-  { ".fini",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".init",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".fini",    5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".init",    5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { NULL,       0, 0, 0,            0 }
 };
 
 /* The hash bucket size is the standard one, namely 4.  */
index 2042e6ae3234fd0bd7933bf1fb08c5e35f411fba..820f80852e292286cd852113aa497444b0718094 100644 (file)
@@ -2405,20 +2405,13 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 
 static struct bfd_elf_special_section const ppc64_elf_special_sections[]=
 {
-  { ".sdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".sbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE },
-  { ".plt",            0,      NULL,   0,
-    SHT_NOBITS,                0 },
-  { ".toc",            0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".toc1",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
-  { ".tocbss",         0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".sdata",   6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+  { ".sbss",    5, -2, SHT_NOBITS,   SHF_ALLOC + SHF_WRITE },
+  { ".plt",     4,  0, SHT_NOBITS,   0 },
+  { ".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 }
 };
 
 struct _ppc64_elf_section_data
index e0bc8df7e5d0fd9e3f1e6e01ca9808ac18c4fb34..4cc20a7c5c49413bff42ef324bf918047e078af2 100644 (file)
@@ -4118,10 +4118,8 @@ sh64_elf64_finish_dynamic_sections (bfd *output_bfd,
 
 static struct bfd_elf_special_section const sh64_elf64_special_sections[]=
 {
-  { ".cranges",                0,      NULL,   0,
-    SHT_PROGBITS,      0 },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".cranges", 8, 0, SHT_PROGBITS, 0 },
+  { NULL,       0, 0, 0,            0 }
 };
 
 #define TARGET_BIG_SYM         bfd_elf64_sh64_vec
index 47f457594d56bdaf0e0f77fe527fae0020d8de3b..c8dd9c49b95eb3df8f3f8a219de4bce20a415b83 100644 (file)
@@ -4748,12 +4748,9 @@ elfNN_ia64_reloc_type_class (rela)
 
 static struct bfd_elf_special_section const elfNN_ia64_special_sections[]=
 {
-  { ".sbss",           5,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
-  { ".sdata",          6,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".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 }
 };
 
 static bfd_boolean
index 919593d187398ac436f95dc5016d64bedfc6de78..0063100f8eca59a854ddb2ef0c2877c85ad3a9ff 100644 (file)
@@ -9296,18 +9296,11 @@ _bfd_mips_elf_print_private_bfd_data (abfd, ptr)
 
 struct bfd_elf_special_section const _bfd_mips_elf_special_sections[]=
 {
-  { ".sdata",          0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
-  { ".sbss",           0,      NULL,   0,
-    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
-  { ".lit4",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
-  { ".lit8",           0,      NULL,   0,
-    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
-  { ".ucode",          0,      NULL,   0,
-    SHT_MIPS_UCODE,    0 },
-  { ".mdebug",         0,      NULL,   0,
-    SHT_MIPS_DEBUG,    0 },
-  { NULL,              0,      NULL,   0,
-    0,                 0 }
+  { ".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 },
+  { ".mdebug", 7,  0, SHT_MIPS_DEBUG, 0 },
+  { NULL,      0,  0, 0,              0 }
 };