From 7f4d39589c642cb9d6a52801d1cf66a0606092de Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 7 May 2005 13:22:57 +0000 Subject: 2005-05-07 H.J. Lu * 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/ChangeLog | 24 ++++++++ bfd/elf-bfd.h | 5 +- bfd/elf.c | 154 ++++++++++++++++++++++++++++++++++++++++++++-------- bfd/elf32-arm.c | 80 ++++++++++++++++++++++++++- bfd/elf32-m32r.c | 37 ++++++++++++- bfd/elf32-m68hc11.c | 53 +++++++++++++++++- bfd/elf32-m68hc12.c | 53 +++++++++++++++++- bfd/elf32-mcore.c | 41 +++++++++++++- bfd/elf32-ppc.c | 59 ++++++++++++++++++-- bfd/elf32-sh64.c | 37 ++++++++++++- bfd/elf32-v850.c | 77 ++++++++++++++++++++++---- bfd/elf32-xtensa.c | 50 ++++++++++++++++- bfd/elf64-alpha.c | 35 +++++++++++- bfd/elf64-hppa.c | 41 +++++++++++++- bfd/elf64-ppc.c | 49 ++++++++++++++++- bfd/elf64-sh64.c | 37 ++++++++++++- bfd/elfxx-ia64.c | 37 ++++++++++++- bfd/elfxx-mips.c | 58 ++++++++++++++++++-- bfd/elfxx-mips.h | 2 +- 19 files changed, 865 insertions(+), 64 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8286fcff14..03b19ab63e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,27 @@ +2005-05-07 H.J. Lu + + * 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. + 2005-05-07 Alan Modra * elf-bfd.h (struct elf_backend_data): Remove got_symbol_offset. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 1318b40ce6..c48d21de9e 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -974,8 +974,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; /* The size in bytes of the header for the GOT. This includes the so-called reserved entries on some systems. */ diff --git a/bfd/elf.c b/bfd/elf.c index 7f402c3cb3..5eac34fe88 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2117,25 +2117,23 @@ bfd_section_from_elf_index (bfd *abfd, unsigned int index) 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 const special_sections[] = { ".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++) { diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 7fdcfb0575..2e5ca4c612 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -6538,8 +6538,8 @@ elf32_arm_symbian_link_hash_table_create (bfd *abfd) 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 const { ".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 diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 55c36f2fc8..d74b9f96d7 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -4183,11 +4183,44 @@ m32r_elf_check_relocs (abfd, info, sec, relocs) 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 diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 8b5a38c2ac..aff4be6a2b 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1257,14 +1257,65 @@ m68hc11_elf_relax_delete_bytes (bfd *abfd, asection *sec, 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 */ +}; #define ELF_ARCH bfd_arch_m68hc11 #define ELF_MACHINE_CODE EM_68HC11 diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c index ecf2fd0641..213ead23b7 100644 --- a/bfd/elf32-m68hc12.c +++ b/bfd/elf32-m68hc12.c @@ -535,14 +535,65 @@ m68hc12_elf_set_mach_from_flags (bfd *abfd) 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 */ +}; #define ELF_ARCH bfd_arch_m68hc12 #define ELF_MACHINE_CODE EM_68HC12 diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index f8f2b227c5..d178748539 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -662,13 +662,52 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) 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 diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index d88d66c80e..ecee78ac06 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1736,18 +1736,69 @@ ppc_elf_additional_program_headers (bfd *abfd) 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 */ }; /* Very simple linked list structure for recording apuinfo values. */ diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index fe85c52f24..dac8bb4d44 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -754,10 +754,43 @@ sh64_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, 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 diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 4fb41ed977..00affbb0d8 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -3121,35 +3121,92 @@ v850_elf_relax_section (abfd, sec, link_info, again) 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 */ }; #define TARGET_LITTLE_SYM bfd_elf32_v850_vec diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index b6b2959c39..ebfaf64841 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -9479,14 +9479,58 @@ xtensa_callback_required_dependence (bfd *abfd, /* 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 */ +}; + #ifndef ELF_ARCH #define TARGET_LITTLE_SYM bfd_elf32_xtensa_le_vec diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 6b247348d9..252af59c4c 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -5370,13 +5370,46 @@ elf64_alpha_reloc_type_class (rela) } } -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. */ diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 1ca533b4e0..9084f1fbb2 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -2671,13 +2671,52 @@ elf64_hppa_elf_get_symbol_type (elf_sym, type) 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 = diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 7ef6d1cdad..fa6b095a1f 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2503,17 +2503,62 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) /* 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; diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 2b1278bba0..c2679e3d1b 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -4063,10 +4063,43 @@ sh64_elf64_merge_symbol_attribute (struct elf_link_hash_entry *h, 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 diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index ca6e54d84e..e64b1d398c 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -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 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 2868ba9a06..6e5d968a27 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -9892,13 +9892,63 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) 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 */ +}; diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 042f74b9b5..6d9b348790 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -126,7 +126,7 @@ extern bfd_boolean _bfd_mips_relax_section 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 -- cgit v1.2.1