* 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.
This commit is contained in:
Alan Modra 2003-09-23 00:40:49 +00:00
parent d902c43ecf
commit 7dcb9820ee
17 changed files with 202 additions and 250 deletions

View 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> 2003-09-21 Daniel Jacobowitz <drow@mvista.com>
* elf64-alpha.c (elf64_alpha_create_got_section): Initialize * elf64-alpha.c (elf64_alpha_create_got_section): Initialize

View file

@ -511,11 +511,16 @@ typedef enum {
struct bfd_elf_special_section struct bfd_elf_special_section
{ {
const char *prefix; const char *prefix;
size_t prefix_length; int prefix_length;
const char *suffix; /* 0 means name must match PREFIX exactly.
size_t suffix_length; -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 type;
int attributes; int attr;
}; };
struct elf_backend_data struct elf_backend_data
@ -1384,8 +1389,8 @@ extern bfd_boolean _bfd_elf_new_section_hook
(bfd *, asection *); (bfd *, asection *);
extern bfd_boolean _bfd_elf_init_reloc_shdr extern bfd_boolean _bfd_elf_init_reloc_shdr
(bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean); (bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean);
extern bfd_boolean _bfd_elf_get_sec_type_attr extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr
(bfd *, const char *, int *, int *); (bfd *, const char *);
/* If the target doesn't have reloc handling written yet: */ /* If the target doesn't have reloc handling written yet: */
extern void _bfd_elf_no_info_to_howto extern void _bfd_elf_no_info_to_howto

182
bfd/elf.c
View file

@ -2019,82 +2019,44 @@ bfd_section_from_elf_index (bfd *abfd, unsigned int index)
static struct bfd_elf_special_section const special_sections[] = static struct bfd_elf_special_section const special_sections[] =
{ {
{ ".bss", 0, NULL, 0, { ".bss", 4, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, { ".comment", 8, 0, SHT_PROGBITS, 0 },
{ ".comment", 0, NULL, 0, { ".data", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, 0 }, { ".data1", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".data", 0, NULL, 0, { ".debug", 6, 0, SHT_PROGBITS, 0 },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ ".data1", 0, NULL, 0, { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".line", 5, 0, SHT_PROGBITS, 0 },
{ ".debug", 0, NULL, 0, { ".rodata", 7, -2, SHT_PROGBITS, SHF_ALLOC },
SHT_PROGBITS, 0 }, { ".rodata1", 8, 0, SHT_PROGBITS, SHF_ALLOC },
{ ".fini", 0, NULL, 0, { ".tbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, { ".tdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
{ ".init", 0, NULL, 0, { ".text", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE },
{ ".line", 0, NULL, 0, { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, 0 }, { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
{ ".rodata", 0, NULL, 0, { ".debug_line", 11, 0, SHT_PROGBITS, 0 },
SHT_PROGBITS, SHF_ALLOC }, { ".debug_info", 11, 0, SHT_PROGBITS, 0 },
{ ".rodata1", 0, NULL, 0, { ".debug_abbrev", 13, 0, SHT_PROGBITS, 0 },
SHT_PROGBITS, SHF_ALLOC }, { ".debug_aranges", 14, 0, SHT_PROGBITS, 0 },
{ ".tbss", 0, NULL, 0, { ".dynamic", 8, 0, SHT_DYNAMIC, SHF_ALLOC },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, { ".dynstr", 7, 0, SHT_STRTAB, SHF_ALLOC },
{ ".tdata", 0, NULL, 0, { ".dynsym", 7, 0, SHT_DYNSYM, SHF_ALLOC },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, { ".got", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".text", 0, NULL, 0, { ".hash", 5, 0, SHT_HASH, SHF_ALLOC },
SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, { ".interp", 7, 0, SHT_PROGBITS, 0 },
{ ".init_array", 0, NULL, 0, { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, { ".shstrtab", 9, 0, SHT_STRTAB, 0 },
{ ".fini_array", 0, NULL, 0, { ".strtab", 7, 0, SHT_STRTAB, 0 },
SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, { ".symtab", 7, 0, SHT_SYMTAB, 0 },
{ ".preinit_array", 0, NULL, 0, { ".gnu.version", 12, 0, SHT_GNU_versym, 0 },
SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, { ".gnu.version_d", 14, 0, SHT_GNU_verdef, 0 },
{ ".debug_line", 0, NULL, 0, { ".gnu.version_r", 14, 0, SHT_GNU_verneed, 0 },
SHT_PROGBITS, 0 }, { ".note", 5, -1, SHT_NOTE, 0 },
{ ".debug_info", 0, NULL, 0, { ".rela", 5, -1, SHT_RELA, 0 },
SHT_PROGBITS, 0 }, { ".rel", 4, -1, SHT_REL, 0 },
{ ".debug_abbrev", 0, NULL, 0, { ".stabstr", 5, 3, SHT_STRTAB, 0 },
SHT_PROGBITS, 0 }, { NULL, 0, 0, 0, 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 }
}; };
static const struct bfd_elf_special_section * static const struct bfd_elf_special_section *
@ -2103,32 +2065,55 @@ get_special_section (const char *name,
unsigned int rela) unsigned int rela)
{ {
int i; int i;
int len = strlen (name);
for (i = 0; special_sections[i].prefix != NULL; i++) for (i = 0; special_sections[i].prefix != NULL; i++)
if (((special_sections[i].prefix_length {
&& strncmp (name, special_sections[i].prefix, int suffix_len;
special_sections[i].prefix_length) == 0 int prefix_len = special_sections[i].prefix_length;
&& (! special_sections[i].suffix_length
|| strcmp ((name + strlen (name) if (len < prefix_len)
- special_sections[i].suffix_length), continue;
special_sections[i].suffix) == 0)) if (memcmp (name, special_sections[i].prefix, prefix_len) != 0)
|| strcmp (name, special_sections[i].prefix) == 0) continue;
&& (rela || special_sections[i].type != SHT_RELA))
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 &special_sections[i];
}
return NULL; return NULL;
} }
bfd_boolean const struct bfd_elf_special_section *
_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name, int *type, int *attr) _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 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. */ /* See if this is one of the special sections. */
if (name) if (name)
{ {
const struct bfd_elf_special_section *ssect = NULL;
unsigned int rela = bed->default_use_rela_p; unsigned int rela = bed->default_use_rela_p;
if (bed->special_sections) 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) if (! ssect)
ssect = get_special_section (name, special_sections, rela); 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_boolean
_bfd_elf_new_section_hook (bfd *abfd, asection *sec) _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
{ {
struct bfd_elf_section_data *sdata; 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; sdata = (struct bfd_elf_section_data *) sec->used_by_bfd;
if (sdata == NULL) if (sdata == NULL)
@ -2164,11 +2142,11 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
} }
elf_section_type (sec) = SHT_NULL; elf_section_type (sec) = SHT_NULL;
if (sec->name && _bfd_elf_get_sec_type_attr (abfd, sec->name, ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name);
&type, &attr)) if (ssect != NULL)
{ {
elf_section_type (sec) = type; elf_section_type (sec) = ssect->type;
elf_section_flags (sec) = attr; elf_section_flags (sec) = ssect->attr;
} }
/* Indicate whether or not this section should use RELA relocations. */ /* Indicate whether or not this section should use RELA relocations. */

View file

@ -2094,12 +2094,9 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
static struct bfd_elf_special_section const m32r_elf_special_sections[]= static struct bfd_elf_special_section const m32r_elf_special_sections[]=
{ {
{ ".sdata", 0, NULL, 0, { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".sbss", 0, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
#define ELF_ARCH bfd_arch_m32r #define ELF_ARCH bfd_arch_m32r

View file

@ -1289,16 +1289,11 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
vectors. */ vectors. */
static struct bfd_elf_special_section const elf32_m68hc11_special_sections[]= static struct bfd_elf_special_section const elf32_m68hc11_special_sections[]=
{ {
{ ".eeprom", 0, NULL, 0, { ".eeprom", 7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".softregs", 9, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".softregs", 0, NULL, 0, { ".page0", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, { ".vectors", 8, 0, SHT_PROGBITS, SHF_ALLOC },
{ ".page0", 0, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".vectors", 0, NULL, 0,
SHT_PROGBITS, SHF_ALLOC },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
#define ELF_ARCH bfd_arch_m68hc11 #define ELF_ARCH bfd_arch_m68hc11

View file

@ -545,16 +545,11 @@ m68hc12_elf_set_mach_from_flags (abfd)
vectors. */ vectors. */
static struct bfd_elf_special_section const elf32_m68hc12_special_sections[]= static struct bfd_elf_special_section const elf32_m68hc12_special_sections[]=
{ {
{ ".eeprom", 0, NULL, 0, { ".eeprom", 7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".softregs", 9, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".softregs", 0, NULL, 0, { ".page0", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, { ".vectors", 8, 0, SHT_PROGBITS, SHF_ALLOC },
{ ".page0", 0, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".vectors", 0, NULL, 0,
SHT_PROGBITS, SHF_ALLOC },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
#define ELF_ARCH bfd_arch_m68hc12 #define ELF_ARCH bfd_arch_m68hc12

View file

@ -683,12 +683,9 @@ mcore_elf_check_relocs (abfd, info, sec, relocs)
static struct bfd_elf_special_section const mcore_elf_special_sections[]= static struct bfd_elf_special_section const mcore_elf_special_sections[]=
{ {
{ ".ctors", 0, NULL, 0, { ".ctors", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".dtors", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".dtors", 0, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
#define TARGET_BIG_SYM bfd_elf32_mcore_big_vec #define TARGET_BIG_SYM bfd_elf32_mcore_big_vec

View 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[]= static struct bfd_elf_special_section const ppc_elf_special_sections[]=
{ {
{ ".tags", 0, NULL, 0, { ".tags", 5, 0, SHT_ORDERED, SHF_ALLOC },
SHT_ORDERED, SHF_ALLOC }, { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".sdata", 0, NULL, 0, { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".sdata2", 7, -2, SHT_PROGBITS, SHF_ALLOC },
{ ".sbss", 0, NULL, 0, { ".sbss2", 6, -2, SHT_PROGBITS, SHF_ALLOC },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, { ".PPC.EMB.apuinfo", 16, 0, SHT_NOTE, 0 },
{ ".sdata2", 0, NULL, 0, { ".PPC.EMB.sdata0", 15, 0, SHT_PROGBITS, SHF_ALLOC },
SHT_PROGBITS, SHF_ALLOC }, { ".PPC.EMB.sbss0", 14, 0, SHT_PROGBITS, SHF_ALLOC },
{ ".sbss2", 0, NULL, 0, { ".plt", 4, 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR },
SHT_PROGBITS, SHF_ALLOC }, { NULL, 0, 0, 0, 0 }
{ ".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 }
}; };
#define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec #define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec

View file

@ -737,10 +737,8 @@ sh64_elf_final_write_processing (bfd *abfd,
static struct bfd_elf_special_section const sh64_elf_special_sections[]= static struct bfd_elf_special_section const sh64_elf_special_sections[]=
{ {
{ ".cranges", 0, NULL, 0, { ".cranges", 8, 0, SHT_PROGBITS, 0 },
SHT_PROGBITS, 0 }, { NULL, 0, 0, 0, 0 }
{ NULL, 0, NULL, 0,
0, 0 }
}; };
#undef TARGET_BIG_SYM #undef TARGET_BIG_SYM

View 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[]= static struct bfd_elf_special_section const v850_elf_special_sections[]=
{ {
{ ".sdata", 0, NULL, 0, { ".sdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, + SHF_V850_GPREL) },
{ ".rosdata", 0, NULL, 0, { ".rosdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC
SHT_PROGBITS, SHF_ALLOC + SHF_V850_GPREL }, + SHF_V850_GPREL) },
{ ".sbss", 0, NULL, 0, { ".sbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, + SHF_V850_GPREL) },
{ ".scommon", 0, NULL, 0, { ".scommon", 8, -2, SHT_V850_SCOMMON, (SHF_ALLOC + SHF_WRITE
SHT_V850_SCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, + SHF_V850_GPREL) },
{ ".tdata", 0, NULL, 0, { ".tdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL }, + SHF_V850_EPREL) },
{ ".tbss", 0, NULL, 0, { ".tbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL }, + SHF_V850_EPREL) },
{ ".tcommon", 0, NULL, 0, { ".tcommon", 8, -2, SHT_V850_TCOMMON, (SHF_ALLOC + SHF_WRITE
SHT_V850_TCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, + SHF_V850_R0REL) },
{ ".zdata", 0, NULL, 0, { ".zdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, + SHF_V850_R0REL) },
{ ".rozdata", 0, NULL, 0, { ".rozdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC
SHT_PROGBITS, SHF_ALLOC + SHF_V850_R0REL }, + SHF_V850_R0REL) },
{ ".zbss", 0, NULL, 0, { ".zbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, + SHF_V850_R0REL) },
{ ".zcommon", 0, NULL, 0, { ".zcommon", 8, -2, SHT_V850_ZCOMMON, (SHF_ALLOC + SHF_WRITE
SHT_V850_ZCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, + SHF_V850_R0REL) },
{ ".call_table_data", 0, NULL, 0, { ".call_table_data", 16, 0, SHT_PROGBITS, (SHF_ALLOC
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + SHF_WRITE) },
{ ".call_table_text", 0, NULL, 0, { ".call_table_text", 16, 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR }, + SHF_EXECINSTR) },
{ NULL, 0, NULL, 0, { NULL, 0, 0, 0, 0 }
0, 0 }
}; };
#define TARGET_LITTLE_SYM bfd_elf32_v850_vec #define TARGET_LITTLE_SYM bfd_elf32_v850_vec

View 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. */ 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 elf_xtensa_special_sections[]=
{ {
{ ".literal", 0, NULL, 0, { ".literal", 8, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, { ".init.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ ".init.literal", 0, NULL, 0, { ".fini.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, { NULL, 0, 0, 0, 0 }
{ ".fini.literal", 0, NULL, 0,
SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ NULL, 0, NULL, 0,
0, 0 }
}; };

View file

@ -5449,12 +5449,9 @@ elf64_alpha_reloc_type_class (rela)
static struct bfd_elf_special_section const elf64_alpha_special_sections[]= static struct bfd_elf_special_section const elf64_alpha_special_sections[]=
{ {
{ ".sdata", 0, NULL, 0, { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
{ ".sbss", 0, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
/* ECOFF swapping routines. These are used when dealing with the /* ECOFF swapping routines. These are used when dealing with the

View 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[]= static struct bfd_elf_special_section const elf64_hppa_special_sections[]=
{ {
{ ".fini", 0, NULL, 0, { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".init", 0, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
/* The hash bucket size is the standard one, namely 4. */ /* The hash bucket size is the standard one, namely 4. */

View 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[]= static struct bfd_elf_special_section const ppc64_elf_special_sections[]=
{ {
{ ".sdata", 0, NULL, 0, { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".sbss", 0, NULL, 0, { ".plt", 4, 0, SHT_NOBITS, 0 },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, { ".toc", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".plt", 0, NULL, 0, { ".toc1", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
SHT_NOBITS, 0 }, { ".tocbss", 7, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ ".toc", 0, NULL, 0, { NULL, 0, 0, 0, 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 }
}; };
struct _ppc64_elf_section_data struct _ppc64_elf_section_data

View file

@ -4118,10 +4118,8 @@ sh64_elf64_finish_dynamic_sections (bfd *output_bfd,
static struct bfd_elf_special_section const sh64_elf64_special_sections[]= static struct bfd_elf_special_section const sh64_elf64_special_sections[]=
{ {
{ ".cranges", 0, NULL, 0, { ".cranges", 8, 0, SHT_PROGBITS, 0 },
SHT_PROGBITS, 0 }, { NULL, 0, 0, 0, 0 }
{ NULL, 0, NULL, 0,
0, 0 }
}; };
#define TARGET_BIG_SYM bfd_elf64_sh64_vec #define TARGET_BIG_SYM bfd_elf64_sh64_vec

View file

@ -4748,12 +4748,9 @@ elfNN_ia64_reloc_type_class (rela)
static struct bfd_elf_special_section const elfNN_ia64_special_sections[]= static struct bfd_elf_special_section const elfNN_ia64_special_sections[]=
{ {
{ ".sbss", 5, NULL, 0, { ".sbss", 5, -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, { ".sdata", 6, -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
{ ".sdata", 6, NULL, 0, { NULL, 0, 0, 0, 0 }
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
{ NULL, 0, NULL, 0,
0, 0 }
}; };
static bfd_boolean static bfd_boolean

View 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[]= struct bfd_elf_special_section const _bfd_mips_elf_special_sections[]=
{ {
{ ".sdata", 0, NULL, 0, { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ ".sbss", 0, NULL, 0, { ".lit4", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, { ".lit8", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ ".lit4", 0, NULL, 0, { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 },
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, { ".mdebug", 7, 0, SHT_MIPS_DEBUG, 0 },
{ ".lit8", 0, NULL, 0, { NULL, 0, 0, 0, 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 }
}; };