powerpc: Protect dl_powerpc_cpu_features on INIT_ARCH() [BZ #26615]
authorRaphael Moreira Zinsly <rzinsly@linux.ibm.com>
Mon, 14 Sep 2020 14:59:24 +0000 (11:59 -0300)
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Tue, 22 Sep 2020 20:45:12 +0000 (17:45 -0300)
dl_powerpc_cpu_features also needs to be protected by __GLRO to check
for the _rtld_global_ro realocation before accessing it.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h

index 17ddfcf..c8fa07f 100644 (file)
@@ -38,7 +38,7 @@
   unsigned long int hwcap = __GLRO(dl_hwcap);                  \
   unsigned long int __attribute__((unused)) hwcap2 = __GLRO(dl_hwcap2); \
   bool __attribute__((unused)) use_cached_memopt =             \
-    GLRO(dl_powerpc_cpu_features).use_cached_memopt;           \
+    __GLRO(dl_powerpc_cpu_features.use_cached_memopt);         \
   if (hwcap & PPC_FEATURE_ARCH_2_06)                           \
     hwcap |= PPC_FEATURE_ARCH_2_05 |                           \
             PPC_FEATURE_POWER5_PLUS |                          \