+2005-04-05 Richard Sandiford <rsandifo@redhat.com>
+
+ * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
+ (_bfd_mips_elf_section_from_shdr): Use it to check for recognized
+ SHT_MIPS_OPTIONS names. Allow all sections with unrecognised
+ section flags.
+ (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P
+ to check for SHT_MIPS_OPTIONS sections.
+ (_bfd_mips_elf_set_section_contents): Likewise.
+
2005-04-04 Eric Christopher <echristo@redhat.com>
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
#define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \
(NEWABI_P (abfd) ? ".MIPS.options" : ".options")
+/* True if NAME is the recognized name of any SHT_MIPS_OPTIONS section.
+ Some IRIX system files do not use MIPS_ELF_OPTIONS_SECTION_NAME. */
+#define MIPS_ELF_OPTIONS_SECTION_NAME_P(NAME) \
+ (strcmp (NAME, ".MIPS.options") == 0 || strcmp (NAME, ".options") == 0)
+
/* The name of the stub section. */
#define MIPS_ELF_STUB_SECTION_NAME(abfd) ".MIPS.stubs"
return FALSE;
break;
case SHT_MIPS_OPTIONS:
- if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) != 0)
+ if (!MIPS_ELF_OPTIONS_SECTION_NAME_P (name))
return FALSE;
break;
case SHT_MIPS_DWARF:
return FALSE;
break;
default:
- return FALSE;
+ break;
}
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
/* The sh_info field is set in final_write_processing. */
}
- else if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
+ else if (MIPS_ELF_OPTIONS_SECTION_NAME_P (name))
{
hdr->sh_type = SHT_MIPS_OPTIONS;
hdr->sh_entsize = 1;
const void *location,
file_ptr offset, bfd_size_type count)
{
- if (strcmp (section->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
+ if (MIPS_ELF_OPTIONS_SECTION_NAME_P (section->name))
{
bfd_byte *c;