sim: frv: fix up various missing prototype warnings
[binutils-gdb.git] / binutils / arsup.c
index f7ce8f0bc82066cfe287f8c0a9d089bdad9f438d..1d4d1ac70b039e6a3e3803ad5e23a04f6b0f1747 100644 (file)
@@ -43,7 +43,7 @@ extern int deterministic;
 static bfd *obfd;
 static char *real_name;
 static char *temp_name;
-static int real_ofd;
+static int temp_fd;
 static FILE *outfile;
 
 static void
@@ -74,7 +74,7 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list)
         want to hack multiple references.  */
       for (ptr = list; ptr; ptr = ptr->next)
        {
-         bfd_boolean found = FALSE;
+         bool found = false;
          bfd *prev = arch;
 
          for (head = arch->archive_next; head; head = head->archive_next)
@@ -82,7 +82,7 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list)
              if (bfd_get_filename (head) != NULL
                  && FILENAME_CMP (ptr->name, bfd_get_filename (head)) == 0)
                {
-                 found = TRUE;
+                 found = true;
                  function (head, prev);
                }
              prev = head;
@@ -98,7 +98,7 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list)
 static void
 ar_directory_doer (bfd *abfd, bfd *ignore ATTRIBUTE_UNUSED)
 {
-  print_arelt_descr(outfile, abfd, verbose, FALSE);
+  print_arelt_descr(outfile, abfd, verbose, false);
 }
 
 void
@@ -152,7 +152,7 @@ void
 ar_open (char *name, int t)
 {
   real_name = xstrdup (name);
-  temp_name = make_tempname (real_name, &real_ofd);
+  temp_name = make_tempname (real_name, &temp_fd);
 
   if (temp_name == NULL)
     {
@@ -162,7 +162,7 @@ ar_open (char *name, int t)
       return;
     }
 
-  obfd = bfd_fdopenw (temp_name, NULL, real_ofd);
+  obfd = bfd_fdopenw (temp_name, NULL, temp_fd);
 
   if (!obfd)
     {
@@ -180,7 +180,11 @@ ar_open (char *name, int t)
          bfd *element;
          bfd *ibfd;
 
+#if BFD_SUPPORTS_PLUGINS         
+         ibfd = bfd_openr (name, "plugin");
+#else
          ibfd = bfd_openr (name, NULL);
+#endif
 
          if (!ibfd)
            {
@@ -348,6 +352,7 @@ ar_save (void)
       if (deterministic > 0)
         obfd->flags |= BFD_DETERMINISTIC_OUTPUT;
 
+      temp_fd = dup (temp_fd);
       bfd_close (obfd);
 
       if (stat (real_name, &target_stat) != 0)
@@ -363,7 +368,7 @@ ar_save (void)
            }
        }
 
-      smart_rename (temp_name, real_name, NULL);
+      smart_rename (temp_name, real_name, temp_fd, NULL, false);
       obfd = 0;
       free (temp_name);
       free (real_name);