diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-06-28 08:33:57 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-06-28 08:33:57 +0200 |
commit | 6bf789d69e6be48419094ca98f064e00297a27d5 (patch) | |
tree | b10799a92799ff4f5f79a1ac77f96b87dcfc293c /elf/ldconfig.c | |
parent | b89d5de2508215ef3131db7bed76ac50b3f4c205 (diff) | |
download | glibc-6bf789d69e6be48419094ca98f064e00297a27d5.tar.gz glibc-6bf789d69e6be48419094ca98f064e00297a27d5.tar.xz glibc-6bf789d69e6be48419094ca98f064e00297a27d5.zip |
elf: Generalize name-based DSO recognition in ldconfig
This introduces <dl-is_dso.h> and the _dl_is_dso function. A test ensures that the official names of libc.so, ld.so, and their versioned names are recognized. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'elf/ldconfig.c')
-rw-r--r-- | elf/ldconfig.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 96bf7700b2..1037e8d0cf 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -43,6 +43,7 @@ #include <ldconfig.h> #include <dl-cache.h> #include <dl-hwcaps.h> +#include <dl-is_dso.h> #include <dl-procinfo.h> @@ -842,9 +843,7 @@ search_dir (const struct dir_entry *entry) subdirectory (if not already processing a glibc-hwcaps subdirectory)? The dynamic linker is also considered as shared library. */ - if (((strncmp (direntry->d_name, "lib", 3) != 0 - && strncmp (direntry->d_name, "ld-", 3) != 0) - || strstr (direntry->d_name, ".so") == NULL) + if (!_dl_is_dso (direntry->d_name) && (direntry->d_type == DT_REG || (entry->hwcaps == NULL && !is_hwcap_platform (direntry->d_name)))) |