]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 5 Apr 2005 07:36:56 +0000 (07:36 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Tue, 5 Apr 2005 07:36:56 +0000 (07:36 +0000)
(_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.

bfd/ChangeLog
bfd/elfxx-mips.c

index d2d927fce221cab9dec7322ea74b70bddfe81fc7..b8e236bbd7f11a772126033abe8cac7c29c7e733 100644 (file)
@@ -1,3 +1,13 @@
+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-01  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors
index 847e7e6af2ee12f7288f1aaab94a3b1a70e80596..eaa927e3add3f7752285139997352e8ca9a92ac1 100644 (file)
@@ -478,6 +478,11 @@ static bfd *reldyn_sorting_bfd;
 #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"
 
@@ -5120,7 +5125,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr,
        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:
@@ -5138,7 +5143,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr,
        return FALSE;
       break;
     default:
-      return FALSE;
+      break;
     }
 
   if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
@@ -5308,7 +5313,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
       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;
@@ -8629,7 +8634,7 @@ _bfd_mips_elf_set_section_contents (bfd *abfd, sec_ptr section,
                                    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;