Remove redundant returns in void functions.
[deliverable/binutils-gdb.git] / gas / config / obj-ecoff.c
index d1eabceefb9f845d4ee4f552c00b00f8a24964da..69f8d9a89ab8dbadcbf7580a7022332e0e47e2b7 100644 (file)
@@ -1,5 +1,5 @@
 /* ECOFF object file format.
-   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    This file was put together by Ian Lance Taylor <ian@cygnus.com>.
@@ -98,18 +98,13 @@ const pseudo_typeS obj_pseudo_table[] =
   { NULL,      s_ignore,               0 }
 };
 
-/* Swap out the symbols and debugging information for BFD.  */
+/* Set section VMAs and GP values before reloc processing.  */
 
 void
-ecoff_frob_file ()
+ecoff_frob_file_before_fix ()
 {
-  const struct ecoff_debug_swap * const debug_swap
-    = &ecoff_backend (stdoutput)->debug_swap;
   bfd_vma addr;
-  asection *sec;
-  HDRR *hdr;
-  char *buf;
-  char *set;
+  asection **sec;
 
   /* Set the section VMA values.  We force the .sdata and .sbss
      sections to the end to ensure that their VMA addresses are close
@@ -143,53 +138,79 @@ ecoff_frob_file ()
   };
 #define n_names ((int) (sizeof (names) / sizeof (names[0])))
 
+  /* Sections that match names, order to be straightened out later.  */
+  asection *secs[n_names];
+  int i;
+
   addr = 0;
-  {
-    /* Sections that match names, order to be straightened out later.  */
-    asection *secs[n_names];
-    /* Linked list of sections with non-matching names.  Random ordering.  */
-    asection *other_sections = 0;
-    /* Pointer to next section, since we're destroying the original
-       ordering.  */
-    asection *next;
-
-    int i;
-
-    for (i = 0; i < n_names; i++)
-      secs[i] = 0;
-    for (sec = stdoutput->sections; sec != (asection *) NULL; sec = next)
-      {
-       next = sec->next;
-       for (i = 0; i < n_names; i++)
-         if (!strcmp (sec->name, names[i]))
-           {
-             secs[i] = sec;
-             break;
-           }
-       if (i == n_names)
+  for (i = 0; i < n_names; i++)
+    secs[i] = 0;
+
+  for (sec = &stdoutput->sections; *sec != (asection *) NULL; )
+    {
+      for (i = 0; i < n_names; i++)
+       if (!strcmp ((*sec)->name, names[i]))
          {
-           bfd_set_section_vma (stdoutput, sec, addr);
-           addr += bfd_section_size (stdoutput, sec);
-           sec->next = other_sections;
-           other_sections = sec;
+           secs[i] = *sec;
+           bfd_section_list_remove (stdoutput, sec);
+           break;
          }
-      }
-    for (i = 0; i < n_names; i++)
-      if (secs[i])
-       {
-         sec = secs[i];
-         bfd_set_section_vma (stdoutput, sec, addr);
-         addr += bfd_section_size (stdoutput, sec);
-       }
-    for (i = n_names - 1; i >= 0; i--)
-      if (secs[i])
+      if (i == n_names)
        {
-         sec = secs[i];
-         sec->next = other_sections;
-         other_sections = sec;
+         bfd_set_section_vma (stdoutput, *sec, addr);
+         addr += bfd_section_size (stdoutput, *sec);
+         sec = &(*sec)->next;
        }
-    stdoutput->sections = other_sections;
+    }
+  for (i = 0; i < n_names; i++)
+    if (secs[i])
+      {
+       bfd_set_section_vma (stdoutput, secs[i], addr);
+       addr += bfd_section_size (stdoutput, secs[i]);
+      }
+  for (i = n_names - 1; i >= 0; i--)
+    if (secs[i])
+      bfd_section_list_insert (stdoutput, &stdoutput->sections, secs[i]);
+
+  /* Fill in the register masks.  */
+  {
+    unsigned long gprmask = 0;
+    unsigned long fprmask = 0;
+    unsigned long *cprmask = NULL;
+
+#ifdef TC_MIPS
+    /* Fill in the MIPS register masks.  It's probably not worth
+       setting up a generic interface for this.  */
+    gprmask = mips_gprmask;
+    cprmask = mips_cprmask;
+#endif
+
+#ifdef TC_ALPHA
+    alpha_frob_ecoff_data ();
+
+    if (! bfd_ecoff_set_gp_value (stdoutput, alpha_gp_value))
+      as_fatal (_("Can't set GP value"));
+
+    gprmask = alpha_gprmask;
+    fprmask = alpha_fprmask;
+#endif
+
+    if (! bfd_ecoff_set_regmasks (stdoutput, gprmask, fprmask, cprmask))
+      as_fatal (_("Can't set register masks"));
   }
+}
+
+/* Swap out the symbols and debugging information for BFD.  */
+
+void
+ecoff_frob_file ()
+{
+  const struct ecoff_debug_swap * const debug_swap
+    = &ecoff_backend (stdoutput)->debug_swap;
+  bfd_vma addr ATTRIBUTE_UNUSED;
+  HDRR *hdr;
+  char *buf;
+  char *set;
 
   /* Build the ECOFF debugging information.  */
   assert (ecoff_data (stdoutput) != 0);
@@ -218,35 +239,7 @@ ecoff_frob_file ()
   SET (external_rfd, crfd, PTR, debug_swap->external_rfd_size);
   SET (external_fdr, ifdMax, PTR, debug_swap->external_fdr_size);
   SET (external_ext, iextMax, PTR, debug_swap->external_ext_size);
-
 #undef SET
-
-  /* Fill in the register masks.  */
-  {
-    unsigned long gprmask = 0;
-    unsigned long fprmask = 0;
-    unsigned long *cprmask = NULL;
-
-#ifdef TC_MIPS
-    /* Fill in the MIPS register masks.  It's probably not worth
-       setting up a generic interface for this.  */
-    gprmask = mips_gprmask;
-    cprmask = mips_cprmask;
-#endif
-
-#ifdef TC_ALPHA
-    alpha_frob_ecoff_data ();
-
-    if (! bfd_ecoff_set_gp_value (stdoutput, alpha_gp_value))
-      as_fatal (_("Can't set GP value"));
-
-    gprmask = alpha_gprmask;
-    fprmask = alpha_fprmask;
-#endif
-
-    if (! bfd_ecoff_set_regmasks (stdoutput, gprmask, fprmask, cprmask))
-      as_fatal (_("Can't set register masks"));
-  }
 }
 
 /* This is called by the ECOFF code to set the external information
@@ -265,7 +258,7 @@ obj_ecoff_set_ext (sym, ext)
   know (bfd_asymbol_flavour (symbol_get_bfdsym (sym))
        == bfd_target_ecoff_flavour);
   esym = ecoffsymbol (symbol_get_bfdsym (sym));
-  esym->local = false;
+  esym->local = FALSE;
   esym->native = xmalloc (debug_swap->external_ext_size);
   (*debug_swap->swap_ext_out) (stdoutput, ext, esym->native);
 }
@@ -310,6 +303,7 @@ const struct format_ops ecoff_format_ops =
   obj_ecoff_frob_symbol,
   ecoff_frob_file,
   0,   /* frob_file_before_adjust */
+  ecoff_frob_file_before_fix,
   0,   /* frob_file_after_relocs */
   0,   /* s_get_size */
   0,   /* s_set_size */
This page took 0.025544 seconds and 4 git commands to generate.