From ff08fc59e36e02074eba8ab39b0d9001363970f0 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Thu, 1 Jun 2017 22:32:03 +0530 Subject: tunables: Use glibc.tune.hwcap_mask tunable instead of _dl_hwcap_mask Drop _dl_hwcap_mask when building with tunables. This completes the transition of hwcap_mask reading from _dl_hwcap_mask to tunables. * elf/dl-hwcaps.h: New file. * elf/dl-hwcaps.c: Include it. (_dl_important_hwcaps)[HAVE_TUNABLES]: Read and update glibc.tune.hwcap_mask. * elf/dl-cache.c: Include dl-hwcaps.h. (_dl_load_cache_lookup)[HAVE_TUNABLES]: Read glibc.tune.hwcap_mask. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * elf/dl-support.c (_dl_hwcap2)[HAVE_TUNABLES]: Drop _dl_hwcap_mask. * elf/rtld.c (rtld_global_ro)[HAVE_TUNABLES]: Drop _dl_hwcap_mask. (process_envvars)[HAVE_TUNABLES]: Likewise. * sysdeps/generic/ldsodefs.h (rtld_global_ro)[HAVE_TUNABLES]: Likewise. * sysdeps/x86/cpu-features.c (init_cpu_features): Don't initialize dl_hwcap_mask when tunables are enabled. --- elf/dl-cache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'elf/dl-cache.c') diff --git a/elf/dl-cache.c b/elf/dl-cache.c index 017c78aae3..e9632da0b3 100644 --- a/elf/dl-cache.c +++ b/elf/dl-cache.c @@ -24,6 +24,7 @@ #include #include #include <_itoa.h> +#include #ifndef _DL_PLATFORMS_COUNT # define _DL_PLATFORMS_COUNT 0 @@ -258,8 +259,10 @@ _dl_load_cache_lookup (const char *name) if (platform != (uint64_t) -1) platform = 1ULL << platform; + uint64_t hwcap_mask = GET_HWCAP_MASK(); + #define _DL_HWCAP_TLS_MASK (1LL << 63) - uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask)) + uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & hwcap_mask) | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK); /* Only accept hwcap if it's for the right platform. */ -- cgit 1.4.1