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-support.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'elf/dl-support.c') diff --git a/elf/dl-support.c b/elf/dl-support.c index 3c46a7a481..c22be854f4 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -164,6 +164,7 @@ uint64_t _dl_hwcap2 __attribute__ ((nocommon)); /* The value of the FPU control word the kernel will preset in hardware. */ fpu_control_t _dl_fpu_control = _FPU_DEFAULT; +#if !HAVE_TUNABLES /* This is not initialized to HWCAP_IMPORTANT, matching the definition of _dl_important_hwcaps, below, where no hwcap strings are ever used. This mask is still used to mediate the lookups in the cache @@ -171,6 +172,7 @@ fpu_control_t _dl_fpu_control = _FPU_DEFAULT; LD_HWCAP_MASK environment variable here), there is no real point in setting _dl_hwcap nonzero below, but we do anyway. */ uint64_t _dl_hwcap_mask __attribute__ ((nocommon)); +#endif /* Prevailing state of the stack. Generally this includes PF_X, indicating it's * executable but this isn't true for all platforms. */ -- cgit v1.2.3