From patchwork Thu Jan 29 00:02:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 434239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 82E701402AE for ; Thu, 29 Jan 2015 11:03:25 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=tBKeS8o5ZroL3efSd4 CzVDN2IzOa7ScfLt0KuxP9kV5RmUj+rZ29dqGaEvC30GdHHV/cXCvD6+IC1oqACv YNMU8HijZsX3Q5ns8Cz+EU3Fr9w6t0Az+2OE6K2JoVl2ukyxB3q+Fws/bszcpkPO 7qhD7d3akCH7j1pJKbNZqn+H4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=zRr2Z65Vmn0n3iC9yzT2zNMv Q78=; b=ZI/bMeeNE43Z5l/LO/ecCkzi3K3pogpdQYs+5HJmOGkTbDlESCDA7QlQ f4ZV7r+2Ojq97ff+3p5aXP1PxpwJZiqA7Uo9tnXxzmFjnA0XVLDgGlK2kpaU6Ckr l+BVw5/oMI7N+FoZjc6dEgnK1hZIfTcVXCgeXLaJO8z1MYDxEsg= Received: (qmail 23587 invoked by alias); 29 Jan 2015 00:02:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23568 invoked by uid 89); 29 Jan 2015 00:02:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 29 Jan 2015 00:02:54 +0000 Received: by mail-oi0-f41.google.com with SMTP id z81so21571682oif.0 for ; Wed, 28 Jan 2015 16:02:52 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.107.133 with SMTP id g127mr3653395oic.67.1422489772304; Wed, 28 Jan 2015 16:02:52 -0800 (PST) Received: by 10.76.134.102 with HTTP; Wed, 28 Jan 2015 16:02:52 -0800 (PST) In-Reply-To: References: <20150128181242.GA4350@intel.com> Date: Wed, 28 Jan 2015 16:02:52 -0800 Message-ID: Subject: Re: PR lto/64837: lto plugin doesn't call ld_plugin_release_input_file From: "H.J. Lu" To: Richard Biener Cc: GCC Patches X-IsSubscribed: yes On Wed, Jan 28, 2015 at 11:37 AM, H.J. Lu wrote: > On Wed, Jan 28, 2015 at 11:19 AM, Richard Biener > wrote: >> On January 28, 2015 7:12:43 PM CET, "H.J. Lu" wrote: >>>Hi, >>> >>>This patch makes claim_file_handler to call release_input_file after it >>>finishes processing input file. OK for trunk? >> >> OK. How did you test this? > > I did normal bootstrap and "make check" on Linux/x86-64. > I also run ld.bfd and ld.gold by hand to verify that release_input_file > is called. > This is needed for LTO build. ar/nm/ranlib don't provide release_input_file. I checked it in as an obvious fix. Index: ChangeLog =================================================================== --- ChangeLog (revision 220212) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2015-01-28 H.J. Lu + * lto-plugin.c (claim_file_handler): Call release_input_file only + if it is not NULL. + +2015-01-28 H.J. Lu + PR lto/64837 * lto-plugin.c (release_input_file): New. (claim_file_handler): Call release_input_file. Index: lto-plugin.c =================================================================== --- lto-plugin.c (revision 220212) +++ lto-plugin.c (working copy) @@ -1007,7 +1007,8 @@ claim_file_handler (const struct ld_plug if (obj.objfile) simple_object_release_read (obj.objfile); - release_input_file (file); + if (release_input_file) + release_input_file (file); return LDPS_OK; }