elf: Add glibc-hwcaps support for LD_LIBRARY_PATH
authorFlorian Weimer <fweimer@redhat.com>
Fri, 4 Dec 2020 08:13:43 +0000 (09:13 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 4 Dec 2020 08:13:43 +0000 (09:13 +0100)
commitdad90d528259b669342757c37dedefa8577e2636
treed0e8197ff0c886c869fa27a557cfbd4627431bf4
parentc41d197ec4a564a588e1cf3855d955297f2915c4
elf: Add glibc-hwcaps support for LD_LIBRARY_PATH

This hacks non-power-set processing into _dl_important_hwcaps.
Once the legacy hwcaps handling goes away, the subdirectory
handling needs to be reworked, but it is premature to do this
while both approaches are still supported.

ld.so supports two new arguments, --glibc-hwcaps-prepend and
--glibc-hwcaps-mask.  Each accepts a colon-separated list of
glibc-hwcaps subdirectory names.  The prepend option adds additional
subdirectories that are searched first, in the specified order.  The
mask option restricts the automatically selected subdirectories to
those listed in the option argument.  For example, on systems where
/usr/lib64 is on the library search path,
--glibc-hwcaps-prepend=valgrind:debug causes the dynamic loader to
search the directories /usr/lib64/glibc-hwcaps/valgrind and
/usr/lib64/glibc-hwcaps/debug just before /usr/lib64 is searched.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
16 files changed:
elf/Makefile
elf/dl-hwcaps-subdirs.c [new file with mode: 0644]
elf/dl-hwcaps.c
elf/dl-hwcaps.h
elf/dl-hwcaps_split.c [new file with mode: 0644]
elf/dl-load.c
elf/dl-main.h
elf/dl-support.c
elf/dl-usage.c
elf/markermodMARKER-VALUE.c [new file with mode: 0644]
elf/rtld.c
elf/tst-dl-hwcaps_split.c [new file with mode: 0644]
elf/tst-glibc-hwcaps-mask.c [new file with mode: 0644]
elf/tst-glibc-hwcaps-prepend.c [new file with mode: 0644]
elf/tst-glibc-hwcaps.c [new file with mode: 0644]
sysdeps/generic/ldsodefs.h