This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/12507: Can't build a program with -flto -nostdlib
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 26 Feb 2011 09:59:48 +1030
- Subject: Re: PATCH: PR ld/12507: Can't build a program with -flto -nostdlib
- References: <20110224225913.GA3169@intel.com>
On Thu, Feb 24, 2011 at 02:59:13PM -0800, H.J. Lu wrote:
> @@ -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. */
It would be better to put the entry symbol, and -u syms on the
entry_symbol chain, into non_ironly_hash.
--
Alan Modra
Australia Development Lab, IBM