From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31768 invoked by alias); 24 Feb 2011 22:59:20 -0000 Received: (qmail 31759 invoked by uid 22791); 24 Feb 2011 22:59:19 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,NO_DNS_FOR_FROM,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Feb 2011 22:59:15 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 24 Feb 2011 14:59:13 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga002.fm.intel.com with ESMTP; 24 Feb 2011 14:59:14 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id C6D4E18084D; Thu, 24 Feb 2011 14:59:13 -0800 (PST) Date: Thu, 24 Feb 2011 22:59:00 -0000 From: "H.J. Lu" To: binutils@sourceware.org Subject: PATCH: PR ld/12507: Can't build a program with -flto -nostdlib Message-ID: <20110224225913.GA3169@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00293.txt.bz2 We should never mark entry symbol IR only. I checked in this patch as an obvious fix. H.J. ---- diff --git a/ld/ChangeLog b/ld/ChangeLog index 7b3d9bd..c672209 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2011-02-24 H.J. Lu + + PR ld/12507 + * plugin.c (get_symbols): Don't mark entry symbol IR only. + 2011-02-18 John David Anglin PR ld/12376 diff --git a/ld/plugin.c b/ld/plugin.c index 628db41..7892e36 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -490,8 +490,10 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms) even potentially-referenced, perhaps in a future final link if this is a partial one, perhaps dynamically at load-time if the 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); + 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); /* If it was originally undefined or common, then it has been resolved; determine how. */