about summary refs log tree commit diff
path: root/elf/tst-unique3lib.cc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-06-25 08:02:30 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-06-25 08:02:33 +0200
commit66db95b6e8264c5a6307f6a9e5285fec76907254 (patch)
tree4cb31ede664f53a72cb761ecb1755d1ac1b5444b /elf/tst-unique3lib.cc
parentac3babc3944ee6b37bcd0dabaa0b778fb942d4aa (diff)
downloadglibc-66db95b6e8264c5a6307f6a9e5285fec76907254.tar.gz
glibc-66db95b6e8264c5a6307f6a9e5285fec76907254.tar.xz
glibc-66db95b6e8264c5a6307f6a9e5285fec76907254.zip
elf: Fix glibc-hwcaps priorities with cache flags mismatches [BZ #27046]
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.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Diffstat (limited to 'elf/tst-unique3lib.cc')
0 files changed, 0 insertions, 0 deletions