Linker scripts

Fangrui Song maskray@sourceware.org
Sun Jan 18 03:05:40 GMT 2026


On Sat, Jan 17, 2026 at 2:53 PM Gordon Messmer <gordon.messmer@gmail.com> wrote:
>
> On 2026-01-17 1:53 PM, Andreas Schwab wrote:
> > On Jan 17 2026, Gordon Messmer wrote:
> >
> >> What does "depends upon" mean in this context? If there is a difference in
> >> the resulting shared library, I don't see it.
> > $ readelf -V elf/ld.so | grep Parent
> >    0x0054: Parent 1: GLIBC_2.2.5
> >    0x0078: Parent 1: GLIBC_2.3
> >    0x009c: Parent 1: GLIBC_2.4
> >    0x00c0: Parent 1: GLIBC_2.34
> >    0x00e4: Parent 1: GLIBC_2.35
>
>
> OK, that's good to know.
>
> What's the practical effect? Is there a reason to depend on a previous
> symbol set?

OK, I've investigated this a bit and amend my previous message

> I believe the two are identical; the version node following the } is purely decorative. In fact, the lld linker simply ignores it.

vd_aux points to the first Verdaux entry, which describes the version
name, while subsequent Verdaux entries describe parent version names.

vd_cnt equals one plus the number of parent version definitions.
However, it is not useful in practice - glibc and FreeBSD rtld ignore
it, and ld.lld and mold simply hard-codes vd_cnt to 1.

The "parent version" concept is purely cosmetic - there is no runtime
behavior different
In glibc, I think the basic symbol versioning behavior stays mostly
the same since 1997.

Only the first Verdaux entry is used by match_version, see vd_next
occurrences in
https://sourceware.org/cgit/glibc/commit/elf/rtld.c?id=ce37fa887b0ea89614d9538e90ade7356b80f48c

glibc ignores vda_next (the pointer to the next Verdaux entry).


More information about the Binutils mailing list