[PATCH] elf: Properly place base symbols in DT_GNU_HASH and DT_HASH
Alan Modra
amodra@gmail.com
Fri Nov 28 22:35:30 GMT 2025
On Fri, Nov 28, 2025 at 08:48:43AM +0800, H.J. Lu wrote:
> The base symbol, a symbol with the empty version string, created by
>
> asm (".symver foo_base, foo@");
>
> is used to provide a compatibility symbol in a versioned shared library
> for binaries linked against the previous unversioned shared library.
> The dynamic linker will pick the first match to resolve the unversioned
> symbol reference. If the newest version, VERS_1,
>
> asm (".symver foo_v1, foo@@VERS_1");
>
> is picked before the base symbol in DT_GNU_HASH and DT_HASH, foo@@VERS_1,
> instead of foo@, will be used to resolve the unversioned reference.
> Properly place base symbols in DT_GNU_HASH and DT_HASH so that they will
> be picked first.
OK.
--
Alan Modra
More information about the Binutils
mailing list