Skip to content

lld: symbols with version index 0 shouldn't be changed to local symbol #168155

@hjl-tools

Description

@hjl-tools

Oracle Solaris 11.4 Linker and Libraries Guide:

https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/linkers-libraries/version-symbol-section.html

defines VER_NDX_LOCAL to 0 with a comment, "Symbol has local scope". This
leads to different interpretations by different linker implementations.
However Solaris as well as ld and ld.so in glibc always treat symbols
with version index 0 as unversioned symbols, defined or undefined, with
global visibility. As discussed in

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

in hindsight, VER_NDX_NONE might be a better name. Ali from Oracle is
working on clarifying what version index 0 really means for unversioned
symbols, defined or undefined, with global visibility. Symbols with version
index 0 should be treated as unversioned without making them a local symbol.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions