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

--- Comment #39 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <[email protected]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e891646a32ac9adcff944d05b14054523f752728

commit e891646a32ac9adcff944d05b14054523f752728
Author: H.J. Lu <[email protected]>
Date:   Sat Nov 15 06:59:56 2025 +0800

    gold: Treat symbols with version index 0 as unversioned

    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 with global binding.  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 with global binding.  In the meantime, update gold to treat
    symbols with version index 0 as unversioned with global binding.

    elfcpp/

            PR gold/33577
            * elfcpp.h (VER_NDX_LOCAL): Update comments.
            (VER_NDX_GLOBAL): Likewise.

    gold/

            PR gold/33577
            * dynobj.cc (Versions::symbol_section_contents): Set unversioned
            symbol version index to VER_NDX_LOCAL.
            * symtab.cc (Symbol_table::add_from_dynobj): Don't check
            VER_NDX_LOCAL.
            * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_pr33577.sh.
            (check_DATA): Add ver_test_pr33577a.syms and
            ver_test_pr33577b.syms.
            (ver_test_pr33577a.syms): New rule.
            (ver_test_pr33577.so): Likewise.
            (ver_test_pr33577b.syms): Likewise.
            (ver_test_pr33577): Likewise.
            * testsuite/Makefile.in: Regenerated.
            * testsuite/ver_matching_test.sh: Updated to checking missing
            Base version.
            * testsuite/ver_test_14.sh (check_missing): New.
            Updated to check missing Base version.
            * testsuite/ver_test_pr33577.sh: New fille.
            * testsuite/ver_test_pr33577a.c: Likewise.
            * testsuite/ver_test_pr33577b.c: Likewise.

    Signed-off-by: H.J. Lu <[email protected]>

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

Reply via email to