[PATCH] elf: Fix glibc-hwcaps priorities with cache flags mismatches [BZ #27046]

Florian Weimer fweimer@redhat.com
Fri Nov 12 13:14:37 GMT 2021


* Florian Weimer:

> * Florian Weimer via Libc-alpha:
>
>> If lib->flags (in the cache) did not match GLRO (dl_correct_cache_id),
>> searching for further glibc-hwcaps entries did not happen, and it
>> was possible that the best glibc-hwcaps was not found.  By accident,
>> this causes a test failure for elf/tst-glibc-hwcaps-prepend-cache
>> on armv7l.
>>
>> This commit changes the cache lookup logic to continue searching
>> if (a) no match has been found, (b) a named glibc-hwcaps match
>> has been found(), or (c) non-glibc-hwcaps match has been found
>> and the entry flags and cache default flags do not match.
>>
>> _DL_CACHE_DEFAULT_ID is used instead of GLRO (dl_correct_cache_id)
>> because the latter is only written once on i386 if loading
>> of libc.so.5 libraries is selected, so GLRO (dl_correct_cache_id)
>> should probably removed in a future change.
>>
>> Tested on i686-linux-gnu, x86_64-linux-gnu, and on an armv7l system that
>> exposed the issue.  Most of the diff is due to whitespace changes.
>
> Ping?
>
>   <https://sourceware.org/pipermail/libc-alpha/2021-June/127862.html>
>
> Is there still interest in fixing this for 32-bit Arm?

Eh, wait, this has already been merged.  I will update the bug.

Thanks,
Florian



More information about the Libc-alpha mailing list