From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16291 invoked by alias); 26 Feb 2011 09:04:45 -0000 Received: (qmail 16282 invoked by uid 22791); 26 Feb 2011 09:04:44 -0000 X-SWARE-Spam-Status: No, hits=-2.4 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-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Feb 2011 09:04:37 +0000 Received: by pwi10 with SMTP id 10so687854pwi.0 for ; Sat, 26 Feb 2011 01:04:36 -0800 (PST) Received: by 10.143.177.8 with SMTP id e8mr2404957wfp.320.1298711073320; Sat, 26 Feb 2011 01:04:33 -0800 (PST) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id m10sm2272188wfl.11.2011.02.26.01.04.30 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Feb 2011 01:04:32 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 2DCC416DE62C; Sat, 26 Feb 2011 19:34:24 +1030 (CST) Date: Sat, 26 Feb 2011 09:04:00 -0000 From: Alan Modra To: "H.J. Lu" Cc: Binutils Subject: Re: PATCH: PR ld/12507: Can't build a program with -flto -nostdlib Message-ID: <20110226090424.GI5959@bubble.grove.modra.org> Mail-Followup-To: "H.J. Lu" , Binutils References: <20110224225913.GA3169@intel.com> <20110225232948.GD5959@bubble.grove.modra.org> <20110225235859.GE5959@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 2011-02/txt/msg00352.txt.bz2 On Fri, Feb 25, 2011 at 08:33:09PM -0800, H.J. Lu wrote: > This patch works. Looks good to me. > diff --git a/ld/plugin.c b/ld/plugin.c > index 7892e36..40acbdb 100644 > --- a/ld/plugin.c > +++ b/ld/plugin.c > @@ -492,8 +492,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin > _symbol *syms) > symbol is externally visible. */ > ironly = (!is_visible_from_outside (&syms[n], owner_sec, blhe) > && !bfd_hash_lookup (non_ironly_hash, syms[n].name, > - FALSE, FALSE) > - && strcmp (syms[n].name, entry_symbol.name) != 0); > + FALSE, FALSE)); > > /* If it was originally undefined or common, then it has been > resolved; determine how. */ > @@ -838,6 +837,8 @@ plugin_call_cleanup (void) > static void > init_non_ironly_hash (void) > { > + struct bfd_sym_chain *sym; > + > if (non_ironly_hash == NULL) > { > non_ironly_hash = > @@ -847,6 +848,12 @@ init_non_ironly_hash (void) > sizeof (struct bfd_hash_entry), > 61)) > einfo (_("%P%F: bfd_hash_table_init failed: %E\n")); > + > + for (sym = &entry_symbol; sym != NULL; sym = sym->next) > + if (sym->name > + && !bfd_hash_lookup (non_ironly_hash, sym->name, TRUE, TRUE)) > + einfo (_("%P%X: hash table failure adding symbol %s\n"), > + sym->name); > } > } -- Alan Modra Australia Development Lab, IBM