https://sourceware.org/bugzilla/show_bug.cgi?id=33577

--- Comment #36 from Ali Bahrami <ali_swbugzilla at emvision dot com> ---
(In reply to H.J. Lu from comment #31)
> Rename to VER_NDX_NONE may be too late.  But
> 
> https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/
> linkers-libraries/version-symbol-section.html
> 
> can be updated to clarify what version index 0 really means for unversioned
> global/weak defined/undefined symbols.

I apologize for not spotting this last week when we
first discussed this, but I think the Solaris docs
do spell out the details for index 0 pretty thoroughly.
It's true that the table says simply "Symbol has local scope",
and that text goes back to the original implementation, but
that table is followed by a bulleted list that gets into
the details:

    > A symbol may be assigned the special reserved
    > index 0. This index can be assigned for any of
    > the following reasons.
    >
    > - A non-global symbol is always assigned VER_NDX_LOCAL.
    >   However, this is rare in practice. Versioning sections
    >   are usually created only in conjunction with the dynamic
    >   symbol table, .dynsym, which only contains global symbols.
    >
    > - A global symbol defined within an object that does not
    >   have a SHT_SUNW_verdef version definition section.
    >
    > - An undefined global symbol defined within an object that
    >   does not have a SHT_SUNW_verneed version dependency section.
    >   Or, an undefined global symbol defined within an object in
    >   which the version dependency section does not assign version
    >   indexes.
    >
    > - The first entry of a symbol table is always NULL. This
    >   entry always receives VER_NDX_LOCAL, however the value
    >   has no particular meaning.

The third bullet ("An undefined global symbol") covers the
situation we've been discussing, and it seems this discussion
has been retracing those steps.

This text is not found in the S9 version of the Solaris LLM
references earlier, nor in the Solaris 10 FCS version from 2005,
but is found in the Solaris 11 FCS version from 2011. That's why
I didn't spot it earlier --- my response was based on reading
the cited link, and clearly I should have looked at the latest
docs as well. However, there's a decent chance that I wrote this
addition (between 2005 and 2011, when S11 shipped, so 16-20 years
ago), so it's probably useful that we've independently verified
what it's saying.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to