From: Alan Modra <amodra@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: bfd_cleanup for object_p
Date: Mon, 02 Mar 2020 13:46:00 -0000 [thread overview]
Message-ID: <20200302134648.GK5384@bubble.grove.modra.org> (raw)
In-Reply-To: <20200302132223.GJ5384@bubble.grove.modra.org>
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.
diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c
index e43982bf08..b733d14249 100644
--- a/bfd/cisco-core.c
+++ b/bfd/cisco-core.c
@@ -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 *
diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c
index 2b4de9e530..2ecd4f17d5 100644
--- a/bfd/hpux-core.c
+++ b/bfd/hpux-core.c
@@ -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);
diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c
index 84dbf4f27f..71e264da4a 100644
--- a/bfd/sco5-core.c
+++ b/bfd/sco5-core.c
@@ -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),
--
Alan Modra
Australia Development Lab, IBM
next prev parent reply other threads:[~2020-03-02 13:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 8:59 Alan Modra
2020-03-02 12:38 ` H.J. Lu
2020-03-02 13:22 ` Alan Modra
2020-03-02 13:46 ` Alan Modra [this message]
2020-03-03 11:14 ` bfd_check_format_matches preserving matches vs. cleanups Alan Modra
2022-09-24 2:05 bfd_cleanup for object_p Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200302134648.GK5384@bubble.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).