PATCH: PR ld/12507: Can't build a program with -flto -nostdlib
Alan Modra
amodra@gmail.com
Fri Feb 25 23:30:00 GMT 2011
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
More information about the Binutils
mailing list