From patchwork Fri Apr 21 02:38:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 86103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp770131vqo; Thu, 20 Apr 2023 19:39:11 -0700 (PDT) X-Google-Smtp-Source: AKy350bapakkgvehVICeXI01zOKWHkUMQhpx26VENd6EztP1i7ErqNwy+FrBHZwbU/r4Wp7TCRKh X-Received: by 2002:a17:906:1b08:b0:94f:9f76:c74d with SMTP id o8-20020a1709061b0800b0094f9f76c74dmr749935ejg.23.1682044751602; Thu, 20 Apr 2023 19:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682044751; cv=none; d=google.com; s=arc-20160816; b=pW8TCpamRwxlyIEEz1Zp2q6S1TJoUaShf58n0E6dv5U0t5pLFgOsCj+oxSfcvrpg8b rHT4rdpKzLppAZ9kaAHnD/8uxLAvZNoKTLE/eEIreGwgKyeigjxe1IJucNEvWblf31T2 RhRczLh77OCSZ0oU+hEpmuH0UMfpkGRMP31nrmkg0aV2kYQrS0I3sh9SUXcnylXCrLQV uvVjJx0eBTqbTodMT60HH8FzWWQPuuRC2pBsLn6t1UOfi0zycsFmnBq+IIPD04VhwBZc jJIq8lCcVpKdhRmjDauiyMyRqicgqy5j6VIjCE3eKvVDlgHZWVcaYZHs/3dnrKVOp83a YPQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=/z8hJ4NO2KnxSnMTNMhFTUZb93JOUaVYypR1DNqkais=; b=Z7udpuG7IReCsid2sIYS3n5a8ik5Vq0P2d1aIO0NCMnKE1KUio8zklanEE0B7p6nNT j/wL2ciHYaVfUzn6q5ZJskF2dqZ1uXSfyFchuh6wOfjxUcuKul5Q7T18MnQSb/1OmunI fGmGYXd68BMbKFciTFAjlDOlbx+sG5d081x66W5tgAztrF+AJe9WW7duuXKw/+aZg0aH Kee2/LelKhvyBzssjGiAsykLV+SpzmNvZL9mvD1VQiLWkXq6Bst/I2ZpzQ71G88QvSOQ HBPKxRYLrWzByXaRnzBPpfpaMaKkKwDZarG7jYajXex8/SYFAOCcVo4HXSBPco8Gu9VL 7y6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ShyIgZrF; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gn10-20020a1709070d0a00b009333705a9edsi3470799ejc.746.2023.04.20.19.39.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 19:39:11 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ShyIgZrF; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34923385772A for ; Fri, 21 Apr 2023 02:39:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34923385772A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682044750; bh=/z8hJ4NO2KnxSnMTNMhFTUZb93JOUaVYypR1DNqkais=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ShyIgZrFY1LqdZRFdT4E+J4iscnP/efWmbdzZOdnTkZYkkcmE5TI1vXrNLjUtOah0 k4ZT5yWm1wIbLnKWmzycv7qGKrDixf0gnsDsmoznmJa897dX659bE8793tNEDaC/cK 8TOf7wdXpjgTbGXhiyB+qAYQ0m7cBB5YiRuUCx34= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id DC5C83858D37 for ; Fri, 21 Apr 2023 02:39:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC5C83858D37 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-63b73203e0aso11386652b3a.1 for ; Thu, 20 Apr 2023 19:39:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682044740; x=1684636740; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/z8hJ4NO2KnxSnMTNMhFTUZb93JOUaVYypR1DNqkais=; b=dRjQzZV1h3jGZxeUeqISOBEE4+8hxIfRtVxcF7XmUO0trLZMN2uQCT/RVfmVQPSHwg HTLNPEyHYPftjdPJiyaIz1zMzpApcFlEgfniJxnns+7yA8dEJRVxSVipJ+dJvu8uZatg 7JuD4fltkVcYp/K4Bdm2ufMdBuRZVLO6rDcM9yTCPEwB9t49Q97G6oY89VD6LetubHXg L9d/Gk7Mp0AUpPYROHEqcvd63xXGStFmfB5eSDBybkIiEPOKCtIO9AhAFoPQzjzrYtJ0 eW747RdrJ6WEHDFAWsylLhDyt4zc2z02w9NgswXdTpjyYCQe6oMcmfP29a+nMB/zhKnI TRgA== X-Gm-Message-State: AAQBX9f7J50btU/Iuyj8uePrSJmvj2EiK7LSCrigiWvMjXFXWH5W8/2T w+ESt4c+SFmDGaizDWL0Od2hwDTvZiM= X-Received: by 2002:a05:6a20:9382:b0:f0:6898:7d4a with SMTP id x2-20020a056a20938200b000f068987d4amr5540261pzh.29.1682044739899; Thu, 20 Apr 2023 19:38:59 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id i18-20020a635412000000b0051322ab5ccdsm1759634pgb.28.2023.04.20.19.38.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 19:38:58 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 9F6C11142C1C; Fri, 21 Apr 2023 12:08:55 +0930 (ACST) Date: Fri, 21 Apr 2023 12:08:55 +0930 To: binutils@sourceware.org Subject: Delete struct artdata archive_head Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763751757644849489?= X-GMAIL-MSGID: =?utf-8?q?1763751757644849489?= This element is unused. Ideally we'd be moving archive_head and other archive specific fields from struct bfd to here, but that's a much larger change than this little bit of cleanup. * libbfd-in.h (struct artdata): Delete archive_head. * libbfd.h: Regenerate. * archive.c, * coff-rs6000.c, * coff64-rs6000.c: Delete comments mentioning artdata archive_head. diff --git a/bfd/archive.c b/bfd/archive.c index 4cc2f7c9487..01bfcfc80a1 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -215,18 +215,7 @@ _bfd_generic_mkarchive (bfd *abfd) size_t amt = sizeof (struct artdata); abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); - if (bfd_ardata (abfd) == NULL) - return false; - - /* Already cleared by bfd_zalloc above. - bfd_ardata (abfd)->cache = NULL; - bfd_ardata (abfd)->archive_head = NULL; - bfd_ardata (abfd)->symdefs = NULL; - bfd_ardata (abfd)->extended_names = NULL; - bfd_ardata (abfd)->extended_names_size = 0; - bfd_ardata (abfd)->tdata = NULL; */ - - return true; + return bfd_ardata (abfd) != NULL; } /* @@ -905,13 +894,6 @@ bfd_generic_archive_p (bfd *abfd) } bfd_ardata (abfd)->first_file_filepos = SARMAG; - /* Cleared by bfd_zalloc above. - bfd_ardata (abfd)->cache = NULL; - bfd_ardata (abfd)->archive_head = NULL; - bfd_ardata (abfd)->symdefs = NULL; - bfd_ardata (abfd)->extended_names = NULL; - bfd_ardata (abfd)->extended_names_size = 0; - bfd_ardata (abfd)->tdata = NULL; */ if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd)) || !BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd))) diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 6c4e32c9f0d..5ea06fa2e09 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1527,13 +1527,6 @@ _bfd_xcoff_archive_p (bfd *abfd) if (bfd_ardata (abfd) == (struct artdata *) NULL) goto error_ret_restore; - /* Cleared by bfd_zalloc above. - bfd_ardata (abfd)->cache = NULL; - bfd_ardata (abfd)->archive_head = NULL; - bfd_ardata (abfd)->symdefs = NULL; - bfd_ardata (abfd)->extended_names = NULL; - bfd_ardata (abfd)->extended_names_size = 0; */ - /* Now handle the two formats. */ if (magic[1] != 'b') { diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index f8a0bde8c30..a4f631ce0e0 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1939,12 +1939,6 @@ xcoff64_archive_p (bfd *abfd) if (bfd_ardata (abfd) == (struct artdata *) NULL) goto error_ret_restore; - /* Already cleared by bfd_zalloc above. - bfd_ardata (abfd)->cache = NULL; - bfd_ardata (abfd)->archive_head = NULL; - bfd_ardata (abfd)->symdefs = NULL; - bfd_ardata (abfd)->extended_names = NULL; - bfd_ardata (abfd)->extended_names_size = 0; */ bfd_ardata (abfd)->first_file_filepos = bfd_scan_vma (hdr.firstmemoff, (const char **) NULL, 10); diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 561cef1a12e..68b5343fd2e 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -75,7 +75,6 @@ struct artdata file_ptr first_file_filepos; /* Speed up searching the armap */ htab_t cache; - bfd *archive_head; /* Only interesting in output routines. */ carsym *symdefs; /* The symdef entries. */ symindex symdef_count; /* How many there are. */ char *extended_names; /* Clever intel extension. */ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index ae17717efa3..bb7f2f1efcf 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -81,7 +81,6 @@ struct artdata file_ptr first_file_filepos; /* Speed up searching the armap */ htab_t cache; - bfd *archive_head; /* Only interesting in output routines. */ carsym *symdefs; /* The symdef entries. */ symindex symdef_count; /* How many there are. */ char *extended_names; /* Clever intel extension. */