From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60159 invoked by alias); 2 Mar 2020 13:46:56 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 60150 invoked by uid 89); 2 Mar 2020 13:46:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=1067, Immediately X-HELO: mail-pj1-f50.google.com Received: from mail-pj1-f50.google.com (HELO mail-pj1-f50.google.com) (209.85.216.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 13:46:55 +0000 Received: by mail-pj1-f50.google.com with SMTP id nm14so1724868pjb.0 for ; Mon, 02 Mar 2020 05:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dvr3C8gG3CDpx0qVZhhzLVPUOz9yD1VCxX9xxmImsxI=; b=mmwkqnLMuFCmHRwlN/mkfZjb5wFs6HE+OMQeu1cWHHllvGXJA8sfuF4DuoUpfomjiY C9YhYpsHdVTvs9UTKq/zNeympJG1wuWpTRBqw3UW/nUiSRHXFotst3MENP8EbUSXlbZp yEXRr/4BNwfTmA1SPH602G18U6T03W9qs3n8HH9KCcMRggS17QTox/99rJNgJAajl1aN vLqrZefF+tXKYI66i774ndd4fVtagFhPfXSpAdaxTnPCV/3VqTam4/XqW8Cy6hz5DdE2 vWemrXsiUFICFeDDsW4aLLrfX2+2R8eLDur/rI+tMqsY/M5XlEA4DPQu6M4uVC0J0ojf 5/Qw== Return-Path: Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id o12sm4100687pjs.6.2020.03.02.05.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 05:46:52 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 141ED8954A; Tue, 3 Mar 2020 00:16:49 +1030 (ACDT) Date: Mon, 02 Mar 2020 13:46:00 -0000 From: Alan Modra To: "H.J. Lu" Cc: Binutils Subject: Re: bfd_cleanup for object_p Message-ID: <20200302134648.GK5384@bubble.grove.modra.org> References: <20200302085904.GH5384@bubble.grove.modra.org> <20200302132223.GJ5384@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200302132223.GJ5384@bubble.grove.modra.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00019.txt 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