PATCH: PR ld/12507: Can't build a program with -flto -nostdlib

H.J. Lu hjl.tools@gmail.com
Fri Feb 25 23:45:00 GMT 2011


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.



More information about the Binutils mailing list