[PATCH v3 04/32] elf: Eliminate second loop in find_version in dl-version.c
Florian Weimer
fweimer@redhat.com
Sun Feb 2 16:42:00 GMT 2025
* Joseph Myers:
> On Thu, 7 Dec 2023, Florian Weimer wrote:
>
>> Turn the assert in _dl_check_map_versions into a proper error
>> because it can be triggered by inconsistent variants of shared
>> objects.
>
> What's involved in such "inconsistent variants of shared objects"? I feel
> like such an error really ought to have an actual test in the glibc
> testsuite (even if we don't have many tests for dynamic linker error
> handling at present), but failing that, more details in the commit message
> of what's needed to result in that error.
I tried to produce a test case, but couldn't find a way without patching
the binaries after linking. I've added this to the commit message:
Turn the assert in _dl_check_map_versions into a proper error
because it can be triggered by inconsistent variants of shared
objects. This assert could fail if the soname in the vn_file field
of the verneed structure for a version is not among the DT_NEEDED
dependencies of an object. With such a discrepancy, the no matching
object might be loaded, hence the assertion failure. Current
binutils ld does not seem to produce such objects, preferring to
create unversioned symbols instead of lifting symbol versions from
indirect dependencies of the objects listed on the command line.
This is why there is no test case for this error.
Thanks,
Florian
More information about the Libc-alpha
mailing list