olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone
00db10
commit 911569d02dec023d949d96aa7b0e828c91c06f55
00db10
Author: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
00db10
Date:   Mon Dec 28 16:36:46 2015 -0200
00db10
00db10
    powerpc: Fix dl-procinfo HWCAP
00db10
    
00db10
    HWCAP-related code should had been updated when the 32 bits of HWCAP were
00db10
    used.  This patch updates the code in dl-procinfo.h to loop through all
00db10
    the 32 bits in HWCAP and updates _dl_powerpc_cap_flags accordingly.
00db10
00db10
diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c
00db10
index 6e7850e..0b55906 100644
00db10
--- a/sysdeps/powerpc/dl-procinfo.c
00db10
+++ b/sysdeps/powerpc/dl-procinfo.c
00db10
@@ -45,11 +45,12 @@
00db10
 #if !defined PROCINFO_DECL && defined SHARED
00db10
   ._dl_powerpc_cap_flags
00db10
 #else
00db10
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[60][10]
00db10
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[64][10]
00db10
 #endif
00db10
 #ifndef PROCINFO_DECL
00db10
 = {
00db10
-    "ppcle", "true_le", "archpmu", "vsx",
00db10
+    "ppcle", "true_le", "", "",
00db10
+    "", "", "archpmu", "vsx",
00db10
     "arch_2_06", "power6x", "dfp", "pa6t",
00db10
     "arch_2_05", "ic_snoop", "smt", "booke",
00db10
     "cellbe", "power5+", "power5", "power4",
00db10
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
00db10
index bce3a49..2187c5e 100644
00db10
--- a/sysdeps/powerpc/dl-procinfo.h
00db10
+++ b/sysdeps/powerpc/dl-procinfo.h
00db10
@@ -22,9 +22,6 @@
00db10
 #include <ldsodefs.h>
00db10
 #include <sysdep.h>	/* This defines the PPC_FEATURE[2]_* macros.  */
00db10
 
00db10
-/* There are 28 bits used, but they are bits 4..31.  */
00db10
-#define _DL_HWCAP_FIRST		4
00db10
-
00db10
 /* The total number of available bits (including those prior to
00db10
    _DL_HWCAP_FIRST).  Some of these bits might not be used.  */
00db10
 #define _DL_HWCAP_COUNT		64
00db10
@@ -68,7 +65,7 @@ static inline const char *
00db10
 __attribute__ ((unused))
00db10
 _dl_hwcap_string (int idx)
00db10
 {
00db10
-  return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST];
00db10
+  return GLRO(dl_powerpc_cap_flags)[idx];
00db10
 }
00db10
 
00db10
 static inline const char *
00db10
@@ -82,7 +79,7 @@ static inline int
00db10
 __attribute__ ((unused))
00db10
 _dl_string_hwcap (const char *str)
00db10
 {
00db10
-  for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
00db10
+  for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
00db10
     if (strcmp (str, _dl_hwcap_string (i)) == 0)
00db10
       return i;
00db10
   return -1;
00db10
@@ -180,7 +177,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
00db10
     case AT_HWCAP:
00db10
       _dl_printf ("AT_HWCAP:       ");
00db10
 
00db10
-      for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i)
00db10
+      for (int i = 0; i <= _DL_HWCAP_LAST; ++i)
00db10
        if (word & (1 << i))
00db10
          _dl_printf (" %s", _dl_hwcap_string (i));
00db10
       break;