]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Re: bfd_cleanup for object_p
authorAlan Modra <amodra@gmail.com>
Mon, 2 Mar 2020 13:38:42 +0000 (00:08 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 2 Mar 2020 13:42:44 +0000 (00:12 +1030)
I hate files that you can't compile.

* cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
* hpux-core.c (hpux_core_core_file_p): Update prototype.
* sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
(core_sco5_vec): Correct initialisers.

bfd/ChangeLog
bfd/cisco-core.c
bfd/hpux-core.c
bfd/sco5-core.c

index 4a64400ca641b45ec66720edd84e04a823425ce4..1f9e20581fe1194f52a4ef4bd28401611d5a6739 100644 (file)
@@ -1,3 +1,10 @@
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
+       * hpux-core.c (hpux_core_core_file_p): Update prototype.
+       * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
+       (core_sco5_vec): Correct initialisers.
+
 2020-03-02  Alan Modra  <amodra@gmail.com>
 
        * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
index e43982bf08f86277a2cd53cdb5fddc3e348697a7..b733d14249463b4c0f78a135b4769957589e7ae1 100644 (file)
@@ -286,19 +286,19 @@ cisco_core_file_validate (bfd *abfd, int crash_info_loc)
   return NULL;
 }
 
-static const bfd_target *
+static bfd_cleanup
 cisco_core_file_p (bfd *abfd)
 {
   int *crash_info_locp;
-  const bfd_target *target = NULL;
+  bfd_cleanup cleanup = NULL;
 
   for (crash_info_locp = crash_info_locs;
-       *crash_info_locp != -1  &&  target == NULL;
+       *crash_info_locp != -1 && cleanup == NULL;
        crash_info_locp++)
     {
-      target = cisco_core_file_validate (abfd, *crash_info_locp);
+      cleanup = cisco_core_file_validate (abfd, *crash_info_locp);
     }
-  return (target);
+  return cleanup;
 }
 
 static char *
index 2b4de9e530e9995ea1cac4d518f6965fbe714233..2ecd4f17d5916f780a7e7940fa3b03bf88e76a6a 100644 (file)
@@ -106,7 +106,7 @@ struct hpux_core_struct
 
 static asection *make_bfd_asection (bfd *, const char *, flagword,
                                    bfd_size_type, bfd_vma, unsigned int);
-static const bfd_target *hpux_core_core_file_p (bfd *);
+static bfd_cleanup hpux_core_core_file_p (bfd *);
 static char *hpux_core_core_file_failing_command (bfd *);
 static int hpux_core_core_file_failing_signal (bfd *);
 static void swap_abort (void);
index 84dbf4f27fc4394935940e1431a263eba59cfe80..71e264da4aa3638ebab6da177abf00adef2a0cbc 100644 (file)
@@ -101,7 +101,7 @@ read_uarea (bfd *abfd, int filepos)
   return &rawptr->u;
 }
 
-const bfd_cleanup
+bfd_cleanup
 sco5_core_file_p (bfd *abfd)
 {
   int coffset_siz, val, nsecs, cheadoffs;
@@ -172,7 +172,7 @@ sco5_core_file_p (bfd *abfd)
                              (file_ptr) coffsets.u_stack))
        goto fail;
 
-      return abfd->xvec;               /* Done for version 1 */
+      return _bfd_no_cleanup;          /* Done for version 1 */
     }
 
   /* Immediately before coreoffsets region is a long with offset in core
@@ -372,12 +372,16 @@ const bfd_target core_sco5_vec =
       sco5_core_file_p                 /* a core file */
     },
     {                          /* bfd_set_format */
-      _bfd_bool_bfd_false_error, bfd_false,
-      _bfd_bool_bfd_false_error, bfd_false
+      _bfd_bool_bfd_false_error,
+      _bfd_bool_bfd_false_error,
+      _bfd_bool_bfd_false_error,
+      _bfd_bool_bfd_false_error
     },
     {                          /* bfd_write_contents */
-      _bfd_bool_bfd_false_error, bfd_false,
-      _bfd_bool_bfd_false_error, bfd_false
+      _bfd_bool_bfd_false_error,
+      _bfd_bool_bfd_false_error,
+      _bfd_bool_bfd_false_error,
+      _bfd_bool_bfd_false_error
     },
 
     BFD_JUMP_TABLE_GENERIC (_bfd_generic),