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

H.J. Lu hjl.tools@gmail.com
Wed Oct 29 02:09:01 GMT 2025


On Wed, Oct 29, 2025 at 9:54 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Undefined symbol without version shouldn't have the BASE version in its
> DT_VERSYM entry.  Instead its DT_VERSYM entry should be all zero to
> indicate that the symbol doesn't have a version.
>
> bfd/
>
> PR ld/33577
> * elflink.c (elf_link_output_extsym): Don't set its DT_VERSYM
> entry for unversioned symbol.
>
> ld/
>
> PR ld/33577
> * testsuite/ld-elf/undefined.d: New file.
> * testsuite/ld-elf/undefined.map: Likewise.
> * testsuite/ld-elf/undefined.s: Likewise.
>
> OK for master?
>

Here is the v2 patch to only check undefined symbols.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-elf-Don-t-set-its-DT_VERSYM-entry-for-unversioned.patch
Type: text/x-patch
Size: 3970 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251029/5aabffcb/attachment-0001.bin>


More information about the Binutils mailing list