diff options
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 68 |
1 files changed, 18 insertions, 50 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 10ce7d1..dc75331 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -9969,63 +9969,31 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) return TRUE; } -static struct bfd_elf_special_section const - mips_special_sections_l[]= +struct bfd_elf_special_section const _bfd_mips_elf_special_sections[] = { { ".lit4", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, { ".lit8", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { NULL, 0, 0, 0, 0 } -}; - -static struct bfd_elf_special_section const - mips_special_sections_m[]= -{ { ".mdebug", 7, 0, SHT_MIPS_DEBUG, 0 }, + { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { ".sdata", 6, -2, 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_s[]= +const struct bfd_elf_special_section * +_bfd_mips_elf_get_sec_type_attr (bfd *abfd, asection *sec) { - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, -}; + const struct bfd_elf_special_section const *ssect; -static struct bfd_elf_special_section const - mips_special_sections_u[]= -{ - { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 }, - { NULL, 0, 0, 0, 0 } -}; + /* See if this is one of the special sections. */ + if (sec->name == NULL) + return NULL; -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 */ -}; + ssect = _bfd_elf_get_special_section (sec->name, + _bfd_mips_elf_special_sections, + sec->use_rela_p); + if (ssect != NULL) + return ssect; + + return _bfd_elf_get_sec_type_attr (abfd, sec); +} |