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: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Cc: Alan Modra <amodra at gmail dot com>
- Date: Fri, 25 Feb 2011 15:45:14 -0800
- Subject: Re: PATCH: PR ld/12507: Can't build a program with -flto -nostdlib
- References: <20110224225913.GA3169@intel.com> <20110225232948.GD5959@bubble.grove.modra.org>
On Fri, Feb 25, 2011 at 3:29 PM, Alan Modra <amodra@gmail.com> wrote:
> 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.
>
I tried it and it doesn't work.
Also, we only care about the entry symbol for LTO.
--
H.J.