This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Help: GOLD unable to find logf() in libm.so when sysroot is enabled
>> gold only warns about undefined references from shared libraries in
>> specific circumstances. See
>> Symbol_table::warn_about_undefined_dynobj_symbol in symtab.cc. I
>> think that particularly relevant here is that gold does not warn about
>> an undefined reference in a shared library that it finds in a "system
>> directory", which basically means a directory found in the sysroot.
>> I'm guessing that that is somehow the difference between your two
>> links. But I don't know why the definition of logf found in libm.so
>> is not satisfying the references from the other shared libraries.
>> Could there be any versions involved?
>
> No. I checked and the reference and definition are both unversioned.
>
> I did find however that I spoke too soon about this problem not being
> fixed in the mainline sources. It seems that somehow the bug is fixed.
> I am currently checking to make sure that this is correct and not just
> me mucking up the testing again, but using a VM makes the whole process
> very slow.
This does sound like a recent bug fix. See if this commit is what
makes the difference:
commit e3f07b5b750554bbbbee1bddc34bb77fd7d31eeb
Author: Cary Coutant <ccoutant@gmail.com>
Date: Tue Sep 27 12:08:19 2016 -0700
Don't treat as separate symbols if unversioned symbol is undefined.
When we see an unversioned symbol reference in a shared library, followed
by a default definition of the symbol in another shared library, we were
treating them as separate symbols. That should only happen when both are
definitions.
gold/
PR gold/20238
* symtab.cc (Symbol_table::define_default_version): Check that
unversioned symbol is defined.
-cary