From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7958 invoked by alias); 15 Jan 2012 01:56:24 -0000 Received: (qmail 7949 invoked by uid 22791); 15 Jan 2012 01:56:23 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 Jan 2012 01:56:08 +0000 Received: by iacb35 with SMTP id b35so68432iac.0 for ; Sat, 14 Jan 2012 17:56:08 -0800 (PST) Received: by 10.50.36.230 with SMTP id t6mr7015546igj.5.1326592568043; Sat, 14 Jan 2012 17:56:08 -0800 (PST) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id r18sm47469422ibh.4.2012.01.14.17.56.06 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jan 2012 17:56:07 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id BA1A8170C2EA; Sun, 15 Jan 2012 12:26:01 +1030 (CST) Date: Sun, 15 Jan 2012 01:56:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: PR12758, lto vs archives. Message-ID: <20120115015601.GF3708@bubble.grove.modra.org> Mail-Followup-To: binutils@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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 X-SW-Source: 2012-01/txt/msg00180.txt.bz2 As the comment says, we only want to open new files. added.head points at start of statement list, ie. we were reopening everything. PR ld/12758 * ldlang.c (lang_process): Don't reopen all files, just those newly added by plugin. Index: ld/ldlang.c =================================================================== RCS file: /cvs/src/src/ld/ldlang.c,v retrieving revision 1.380 diff -u -p -r1.380 ldlang.c --- ld/ldlang.c 15 Nov 2011 18:22:27 -0000 1.380 +++ ld/ldlang.c 15 Jan 2012 01:46:38 -0000 @@ -1,6 +1,6 @@ /* Linker command language support. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -6590,7 +6590,7 @@ lang_process (void) plugin_error_plugin ()); /* Open any newly added files, updating the file chains. */ link_info.loading_lto_outputs = TRUE; - open_input_bfds (added.head, OPEN_BFD_NORMAL); + open_input_bfds (*added.tail, OPEN_BFD_NORMAL); /* Restore the global list pointer now they have all been added. */ lang_list_remove_tail (stat_ptr, &added); /* And detach the fresh ends of the file lists. */ -- Alan Modra Australia Development Lab, IBM