[PATCH v3] elf: Don't set its DT_VERSYM entry for unversioned symbol

H.J. Lu hjl.tools@gmail.com
Wed Nov 5 07:02:37 GMT 2025


On Wed, Nov 5, 2025 at 2:55 PM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Alan,
>
> > On Fri, Oct 31, 2025 at 07:21:37AM +0800, H.J. Lu wrote:
> >> Here is the v3 patch with updated tests in ld-elfvers.   I also updated
> >> elf_link_output_extsym to handle defined symbol without version with
> >> a test.
> >>
> >> OK for master?
>
> I wonder if we should add the testcase attached to the PR, adjusted to
> work on all targets?
>
>
> ld: Add testcase for PR ld/PR33577
>
> This patch adds a testcase for the already fixed PR ld/PR33577.  Before
> the patch, show_undef_weak would be incorrectly bound to the Base
> version of the shared object:
>
> 0000000000000000  w   D  *UND*   0000000000000000  Base        show_undef_weak
>
> while now it's not anymore:
>
> 0000000000000000  w   D  *UND*  0000000000000000              show_undef_weak
>
> Tested on sparc{,v9}-sun-solaris2.11, {amd64,i386}-pc-solaris2.11, and
> {x86_64,i686}-pc-linux-gnu.
>
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
> 2025-10-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         ld:
>         PR ld/33577
>         * testsuite/ld-elfvers/vers33.c: New test.
>         * testsuite/ld-elfvers/vers33.dsym: Likewise.
>         * testsuite/ld-elfvers/vers33.map: Likewise.
>         * testsuite/ld-elfvers/vers33.ver: Likewise.
>         * testsuite/ld-elfvers/vers.exp: Run it.
>

I don't think it is necessary since it has been covered by
ld-elfvers/vers16.dsym.

-- 
H.J.


More information about the Binutils mailing list