]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix output of LD_SHOW_AUXV=1.
authorStefan Liebler <stli@linux.ibm.com>
Wed, 13 Mar 2019 09:45:35 +0000 (10:45 +0100)
committerStefan Liebler <stli@linux.ibm.com>
Wed, 13 Mar 2019 09:45:35 +0000 (10:45 +0100)
Starting with commit 1616d034b61622836d3a36af53dcfca7624c844e
the output was corrupted on some platforms as _dl_procinfo
was called for every auxv entry and on some architectures like s390
all entries were represented as "AT_HWCAP".

This patch is removing the condition and let _dl_procinfo decide if
an entry is printed in a platform specific or generic way.
This patch also adjusts all _dl_procinfo implementations which assumed
that they are only called for AT_HWCAP or AT_HWCAP2. They are now just
returning a non-zero-value for entries which are not handled platform
specifc.

ChangeLog:

* elf/dl-sysdep.c (_dl_show_auxv): Remove condition and always
call _dl_procinfo.
* sysdeps/unix/sysv/linux/s390/dl-procinfo.h (_dl_procinfo):
Ignore types other than AT_HWCAP.
* sysdeps/sparc/dl-procinfo.h (_dl_procinfo): Likewise.
* sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_dl_procinfo):
Likewise.
* sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Adjust comment
in the case of falling back to generic output mechanism.
* sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_dl_procinfo):
Likewise.

ChangeLog
elf/dl-sysdep.c
sysdeps/powerpc/dl-procinfo.h
sysdeps/sparc/dl-procinfo.h
sysdeps/unix/sysv/linux/arm/dl-procinfo.h
sysdeps/unix/sysv/linux/i386/dl-procinfo.h
sysdeps/unix/sysv/linux/s390/dl-procinfo.h

index 14d08727d4f828b3fb2949792097ed0e196fac06..50acb42a2320caed24733738eeef7d32a0db9f3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2019-03-13  Stefan Liebler  <stli@linux.ibm.com>
+
+       * elf/dl-sysdep.c (_dl_show_auxv): Remove condition and always
+       call _dl_procinfo.
+       * sysdeps/unix/sysv/linux/s390/dl-procinfo.h (_dl_procinfo):
+       Ignore types other than AT_HWCAP.
+       * sysdeps/sparc/dl-procinfo.h (_dl_procinfo): Likewise.
+       * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_dl_procinfo):
+       Likewise.
+       * sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Adjust comment
+       in the case of falling back to generic output mechanism.
+       * sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_dl_procinfo):
+       Likewise.
+
 2019-03-12  Florian Weimer  <fweimer@redhat.com>
 
        * elf/elf.h (DF_1_KMOD, DF_1_WEAKFILTER, DF_1_NOCOMMON): Define.
index 5f6c679a3fa03d3a7b746c1ad261d2080e36efee..5d19b100b2fbd9adcfc0cb7342799778660846fd 100644 (file)
@@ -328,14 +328,9 @@ _dl_show_auxv (void)
       assert (AT_NULL == 0);
       assert (AT_IGNORE == 1);
 
-      if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2
-         || AT_L1I_CACHEGEOMETRY || AT_L1D_CACHEGEOMETRY
-         || AT_L2_CACHEGEOMETRY || AT_L3_CACHEGEOMETRY)
-       {
-         /* These are handled in a special way per platform.  */
-         if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0)
-           continue;
-       }
+      /* Some entries are handled in a special way per platform.  */
+      if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0)
+       continue;
 
       if (idx < sizeof (auxvars) / sizeof (auxvars[0])
          && auxvars[idx].form != unknown)
index f542f7318f032c0d8176f133e390e63eb3519e74..dfc3b33a72188d6b4a824f7008e7bfe6413ec873 100644 (file)
@@ -225,7 +225,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
        break;
       }
     default:
-      /* This should not happen.  */
+      /* Fallback to generic output mechanism.  */
       return -1;
     }
    _dl_printf ("\n");
index 282b8c5117d2a0ef752fdf58c9c7f32bc1ce342c..64ee267fc7f28e16d14e6af3970be5cc9e7f14e1 100644 (file)
@@ -31,8 +31,8 @@ _dl_procinfo (unsigned int type, unsigned long int word)
 {
   int i;
 
-  /* Fallback to unknown output mechanism.  */
-  if (type == AT_HWCAP2)
+  /* Fallback to generic output mechanism.  */
+  if (type != AT_HWCAP)
     return -1;
 
   _dl_printf ("AT_HWCAP:   ");
index 66c00297b743f3ac28ce8c89718378a629751c6e..05c62c868773e2a614bb40c53e22e587d57b6ef5 100644 (file)
@@ -67,7 +67,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
        break;
       }
     default:
-      /* This should not happen.  */
+      /* Fallback to generic output mechanism.  */
       return -1;
     }
   _dl_printf ("\n");
index 22b43431bcc993dc622772190f9ba607e85a26a5..0585cdaa9c1a2eecde3ba190b3c416710b42d3a9 100644 (file)
@@ -30,8 +30,8 @@ _dl_procinfo (unsigned int type, unsigned long int word)
      in the kernel sources.  */
   int i;
 
-  /* Fallback to unknown output mechanism.  */
-  if (type == AT_HWCAP2)
+  /* Fallback to generic output mechanism.  */
+  if (type != AT_HWCAP)
     return -1;
 
   _dl_printf ("AT_HWCAP:   ");
index 19329a335b00c527cb2800cc8553fac57e2870c0..d67fde368f464ff29651d80032ccfb2cef0ae7c9 100644 (file)
@@ -32,8 +32,8 @@ _dl_procinfo (unsigned int type, unsigned long int word)
      in the kernel sources.  */
   int i;
 
-  /* Fallback to unknown output mechanism.  */
-  if (type == AT_HWCAP2)
+  /* Fallback to generic output mechanism.  */
+  if (type != AT_HWCAP)
     return -1;
 
   _dl_printf ("AT_HWCAP:   ");