public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] elf: Fix hwcaps string size overestimation
@ 2022-09-05 18:06 Javier Pello
  2022-09-05 18:09 ` [PATCH 1/4] " Javier Pello
                   ` (4 more replies)
  0 siblings, 5 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-05 18:06 UTC (permalink / raw)
  To: libc-alpha

Dear list,

Here is a series of patches related to the construction of the hwcaps
power set strings in function _dl_important_hwcaps in elf/dl-hwcaps.c.

The first patch is the main one. It fixes an overallocation of memory
for the subdirectory strings in _dl_important_hwcaps that was introduced
when adding glibc-hwcaps support for LD_LIBRARY_PATH. This overallocation
does not have any user-visible impact (extra space is simply unused) but
it would be nice to have it fixed.

The other patches are small changes, also in _dl_important_hwcaps, that
I have been carrying around for some time now, and I am submitting them
in case there is interest in having them merged. The last one improves
generation of the hwcaps power set strings by using a single pass over
all needed strings, instead of two, resulting in shorter code.

The third and fourth patches could conceivably be squashed together.

Regards,
Javier

Javier Pello (4):
  elf: Fix hwcaps string size overestimation
  elf: Simplify hwcaps masked value bit counting
  elf: Remove unneeded conditional in _dl_important_hwcaps
  elf: Simplify hwcaps power set string construction

 elf/dl-hwcaps.c | 98 +++++++++++++++++++------------------------------
 1 file changed, 38 insertions(+), 60 deletions(-)

-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 1/4] elf: Fix hwcaps string size overestimation
  2022-09-05 18:06 [PATCH 0/4] elf: Fix hwcaps string size overestimation Javier Pello
@ 2022-09-05 18:09 ` Javier Pello
  2022-09-08 10:15   ` Florian Weimer
  2022-09-05 18:10 ` [PATCH 2/4] elf: Simplify hwcaps masked value bit counting Javier Pello
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-05 18:09 UTC (permalink / raw)
  To: libc-alpha

Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
support for LD_LIBRARY_PATH and, for this, it adjusted the total
string size required in _dl_important_hwcaps. However, in doing so
it inadvertently altered the calculation of the size required for
the power set strings, as the computation of the power set string
size depended on the first value assigned to the total variable,
which is later shifted, resulting in overallocation of string
space. Fix this now by using a different variable to hold the
string size required for glibc-hwcaps.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-hwcaps.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 6f161f6a..92eb5379 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
      and a "/" suffix once stored in the result.  */
   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
-  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
 		  + hwcaps_counts.total_length);
 
   /* Count the number of bits set in the masked value.  */
@@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   assert (m == cnt);
 
   /* Determine the total size of all strings together.  */
+  size_t total;
   if (cnt == 1)
-    total += temp[0].len + 1;
+    total = temp[0].len + 1;
   else
     {
-      total += temp[0].len + temp[cnt - 1].len + 2;
+      total = temp[0].len + temp[cnt - 1].len + 2;
       if (cnt > 2)
 	{
 	  total <<= 1;
@@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   /* This is the overall result, including both glibc-hwcaps
      subdirectories and the legacy hwcaps subdirectories using the
      power set construction.  */
+  total += hwcaps_sz;
   struct r_strlenpair *overall_result
     = malloc (*sz * sizeof (*result) + total);
   if (overall_result == NULL)
-- 
2.36.0


^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 2/4] elf: Simplify hwcaps masked value bit counting
  2022-09-05 18:06 [PATCH 0/4] elf: Fix hwcaps string size overestimation Javier Pello
  2022-09-05 18:09 ` [PATCH 1/4] " Javier Pello
@ 2022-09-05 18:10 ` Javier Pello
  2022-09-05 18:12 ` [PATCH 3/4] elf: Remove unneeded conditional in _dl_important_hwcaps Javier Pello
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-05 18:10 UTC (permalink / raw)
  To: libc-alpha

Use a simpler way to count the number of bits set in the masked
value in _dl_important_hwcaps.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-hwcaps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 92eb5379..8f11a18f 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -197,8 +197,8 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
 		  + hwcaps_counts.total_length);
 
   /* Count the number of bits set in the masked value.  */
-  for (n = 0; (~((1ULL << n) - 1) & masked) != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
+  for (uint64_t mm = masked; mm != 0; mm >>= 1)
+    if ((mm & 1ULL) != 0)
       ++cnt;
 
   /* For TLS enabled builds always add 'tls'.  */
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 3/4] elf: Remove unneeded conditional in _dl_important_hwcaps
  2022-09-05 18:06 [PATCH 0/4] elf: Fix hwcaps string size overestimation Javier Pello
  2022-09-05 18:09 ` [PATCH 1/4] " Javier Pello
  2022-09-05 18:10 ` [PATCH 2/4] elf: Simplify hwcaps masked value bit counting Javier Pello
@ 2022-09-05 18:12 ` Javier Pello
  2022-09-05 18:13 ` [PATCH 4/4] elf: Simplify hwcaps power set string construction Javier Pello
  2022-09-06  7:35 ` [PATCH 0/4] elf: Fix hwcaps string size overestimation Florian Weimer
  4 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-05 18:12 UTC (permalink / raw)
  To: libc-alpha

_dl_important_hwcaps had a special case for building the power set
strings when cnt == 2, but the generic case does exactly the same.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-hwcaps.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 8f11a18f..b248f74b 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -307,31 +307,23 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   result[1].str = result[0].str = cp;
 #define add(idx) \
       cp = __mempcpy (__mempcpy (cp, temp[idx].str, temp[idx].len), "/", 1);
-  if (cnt == 2)
-    {
-      add (1);
-      add (0);
-    }
-  else
+  n = 1 << (cnt - 1);
+  do
     {
-      n = 1 << (cnt - 1);
-      do
-	{
-	  n -= 2;
+      n -= 2;
 
-	  /* We always add the last string.  */
-	  add (cnt - 1);
+      /* We always add the last string.  */
+      add (cnt - 1);
 
-	  /* Add the strings which have the bit set in N.  */
-	  for (m = cnt - 2; m > 0; --m)
-	    if ((n & (1 << m)) != 0)
-	      add (m);
+      /* Add the strings which have the bit set in N.  */
+      for (m = cnt - 2; m > 0; --m)
+	if ((n & (1 << m)) != 0)
+	  add (m);
 
-	  /* Always add the first string.  */
-	  add (0);
-	}
-      while (n != 0);
+      /* Always add the first string.  */
+      add (0);
     }
+  while (n != 0);
 #undef add
 
   /* Now we are ready to install the string pointers and length.  */
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 4/4] elf: Simplify hwcaps power set string construction
  2022-09-05 18:06 [PATCH 0/4] elf: Fix hwcaps string size overestimation Javier Pello
                   ` (2 preceding siblings ...)
  2022-09-05 18:12 ` [PATCH 3/4] elf: Remove unneeded conditional in _dl_important_hwcaps Javier Pello
@ 2022-09-05 18:13 ` Javier Pello
  2022-09-06  7:35 ` [PATCH 0/4] elf: Fix hwcaps string size overestimation Florian Weimer
  4 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-05 18:13 UTC (permalink / raw)
  To: libc-alpha

The power set strings in _dl_important_hwcaps were being computed
in two passes, one to generate the strings and another one to store
the pointers in the result array. Do it in a single pass instead,
as this is simpler.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-hwcaps.c | 58 ++++++++++++++++++-------------------------------
 1 file changed, 21 insertions(+), 37 deletions(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index b248f74b..93a9c56d 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -176,7 +176,6 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   size_t cnt = GLRO (dl_platform) != NULL;
   size_t n, m;
   struct r_strlenpair *result;
-  struct r_strlenpair *rp;
   char *cp;
 
   /* glibc-hwcaps subdirectories.  These are exempted from the power
@@ -304,63 +303,48 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
 	      #3: 0, 3			1001
      This allows the representation of all possible combinations of
      capability names in the string.  First generate the strings.  */
-  result[1].str = result[0].str = cp;
+  struct r_strlenpair *rp = result;
+  n = 1 << (cnt - 1);
+  struct r_strlenpair *rq = rp + n;
 #define add(idx) \
       cp = __mempcpy (__mempcpy (cp, temp[idx].str, temp[idx].len), "/", 1);
-  n = 1 << (cnt - 1);
   do
     {
       n -= 2;
 
+      /* Strings in the first half include the first component. */
+      rp[1].str = rp[0].str = cp;
+
       /* We always add the last string.  */
       add (cnt - 1);
 
+      /* Strings in the second half start after the first component. */
+      rq[1].str = rq[0].str = cp;
+
       /* Add the strings which have the bit set in N.  */
       for (m = cnt - 2; m > 0; --m)
 	if ((n & (1 << m)) != 0)
 	  add (m);
 
+      /* Odd-numbered strings end before before the last component. */
+      rp[1].len = cp - rp[1].str;
+      rq[1].len = cp - rq[1].str;
+
       /* Always add the first string.  */
       add (0);
-    }
-  while (n != 0);
-#undef add
 
-  /* Now we are ready to install the string pointers and length.  */
-  for (n = 0; n < (1UL << cnt); ++n)
-    result[n].len = 0;
-  n = cnt;
-  do
-    {
-      size_t mask = 1 << --n;
+      /* Even-numbered strings include the last component. */
+      rp[0].len = cp - rp[0].str;
+      rq[0].len = cp - rq[0].str;
 
-      rp = result;
-      for (m = 1 << cnt; m > 0; ++rp)
-	if ((--m & mask) != 0)
-	  rp->len += temp[n].len + 1;
+      rp += 2;
+      rq += 2;
     }
   while (n != 0);
+#undef add
 
-  /* The first half of the strings all include the first string.  */
-  n = (1 << cnt) - 2;
-  rp = &result[2];
-  while (n != (1UL << (cnt - 1)))
-    {
-      if ((--n & 1) != 0)
-	rp[0].str = rp[-2].str + rp[-2].len;
-      else
-	rp[0].str = rp[-1].str;
-      ++rp;
-    }
-
-  /* The second half starts right after the first part of the string of
-     the corresponding entry in the first half.  */
-  do
-    {
-      rp[0].str = rp[-(1 << (cnt - 1))].str + temp[cnt - 1].len + 1;
-      ++rp;
-    }
-  while (--n != 0);
+  /* Assert that we got memory allocation right. */
+  assert (cp == (char *) (overall_result + *sz) + total);
 
   /* The maximum string length.  */
   if (result[0].len > hwcaps_counts.maximum_length)
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 0/4] elf: Fix hwcaps string size overestimation
  2022-09-05 18:06 [PATCH 0/4] elf: Fix hwcaps string size overestimation Javier Pello
                   ` (3 preceding siblings ...)
  2022-09-05 18:13 ` [PATCH 4/4] elf: Simplify hwcaps power set string construction Javier Pello
@ 2022-09-06  7:35 ` Florian Weimer
  2022-09-06 18:12   ` Javier Pello
  4 siblings, 1 reply; 53+ messages in thread
From: Florian Weimer @ 2022-09-06  7:35 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

> Here is a series of patches related to the construction of the hwcaps
> power set strings in function _dl_important_hwcaps in elf/dl-hwcaps.c.

We deprecated this mechanism in glibc 2.33.  I think it's time to remove
it in glibc 2.37.

Since you are evidently familiar with the code now, would like to
implement the removal?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 0/4] elf: Fix hwcaps string size overestimation
  2022-09-06  7:35 ` [PATCH 0/4] elf: Fix hwcaps string size overestimation Florian Weimer
@ 2022-09-06 18:12   ` Javier Pello
  2022-09-08 11:23     ` Florian Weimer
  0 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-06 18:12 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

> We deprecated this mechanism in glibc 2.33.  I think it's time
> to remove it in glibc 2.37.
> 
> Since you are evidently familiar with the code now,

That may be a bit of a stretch. :-)

> would like to implement the removal?

What would this removal be? Do you want _dl_important_hwcaps to
return only the glibc-hwcaps subdirectories, and not the legacy
hwcaps power set subdirectories? That should be doable.

In any case, even if hwcaps power set support is removed, I think
that at least my first patch sould be applied first. If the removal
were to be reverted later, or if somebody looked at the code as it
was before the removal for whatever reason, I think that it would
be better if it had been left in the best possible shape, at least
with the overallocation bug fixed.

Regards,
Javier

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 1/4] elf: Fix hwcaps string size overestimation
  2022-09-05 18:09 ` [PATCH 1/4] " Javier Pello
@ 2022-09-08 10:15   ` Florian Weimer
  0 siblings, 0 replies; 53+ messages in thread
From: Florian Weimer @ 2022-09-08 10:15 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

> Commit dad90d528259b669342757c37dedefa8577e2636 added glibc-hwcaps
> support for LD_LIBRARY_PATH and, for this, it adjusted the total
> string size required in _dl_important_hwcaps. However, in doing so
> it inadvertently altered the calculation of the size required for
> the power set strings, as the computation of the power set string
> size depended on the first value assigned to the total variable,
> which is later shifted, resulting in overallocation of string
> space. Fix this now by using a different variable to hold the
> string size required for glibc-hwcaps.
>
> Signed-off-by: Javier Pello <devel@otheo.eu>
> ---
>  elf/dl-hwcaps.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
> index 6f161f6a..92eb5379 100644
> --- a/elf/dl-hwcaps.c
> +++ b/elf/dl-hwcaps.c
> @@ -193,7 +193,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
>    /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
>       and a "/" suffix once stored in the result.  */
>    hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
> -  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
> +  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
>  		  + hwcaps_counts.total_length);
>  
>    /* Count the number of bits set in the masked value.  */
> @@ -229,11 +229,12 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
>    assert (m == cnt);
>  
>    /* Determine the total size of all strings together.  */
> +  size_t total;
>    if (cnt == 1)
> -    total += temp[0].len + 1;
> +    total = temp[0].len + 1;
>    else
>      {
> -      total += temp[0].len + temp[cnt - 1].len + 2;
> +      total = temp[0].len + temp[cnt - 1].len + 2;
>        if (cnt > 2)
>  	{
>  	  total <<= 1;
> @@ -255,6 +256,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
>    /* This is the overall result, including both glibc-hwcaps
>       subdirectories and the legacy hwcaps subdirectories using the
>       power set construction.  */
> +  total += hwcaps_sz;
>    struct r_strlenpair *overall_result
>      = malloc (*sz * sizeof (*result) + total);
>    if (overall_result == NULL)

This patch looks good to me.  I will push it for you after some testing.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 0/4] elf: Fix hwcaps string size overestimation
  2022-09-06 18:12   ` Javier Pello
@ 2022-09-08 11:23     ` Florian Weimer
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
  0 siblings, 1 reply; 53+ messages in thread
From: Florian Weimer @ 2022-09-08 11:23 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

>> We deprecated this mechanism in glibc 2.33.  I think it's time
>> to remove it in glibc 2.37.
>> 
>> Since you are evidently familiar with the code now,
>
> That may be a bit of a stretch. :-)
>
>> would like to implement the removal?
>
> What would this removal be? Do you want _dl_important_hwcaps to
> return only the glibc-hwcaps subdirectories, and not the legacy
> hwcaps power set subdirectories? That should be doable.

Exactly.  And in separate commits, update ldconfig and the cache reading
logic in elf/dl-cache.c.

> In any case, even if hwcaps power set support is removed, I think
> that at least my first patch sould be applied first. If the removal
> were to be reverted later, or if somebody looked at the code as it
> was before the removal for whatever reason, I think that it would
> be better if it had been left in the best possible shape, at least
> with the overallocation bug fixed.

Agreed.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 0/6] Remove legacy hwcaps support
  2022-09-08 11:23     ` Florian Weimer
@ 2022-09-14 18:07       ` Javier Pello
  2022-09-14 18:08         ` [PATCH 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
                           ` (7 more replies)
  0 siblings, 8 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:07 UTC (permalink / raw)
  To: libc-alpha

Here is a patch series to remove legacy hwcaps support, which was
deprecated in 2.33, from the dynamic loader and ldconfig, as
discussed.

The first four patches implement the removal and then simplify some
code in elf/cache.c. The fifth patch removes _dl_string_hwcap from
the code base, as it becomes unused after the other ones, but I am
not sure if this is wanted or not. The sixth patch simplifies
printing of hwcaps subdirectories in the output of ld.so --help,
as using the print_hwcap_1 machinery looks like an overkill after
the legacy hwcaps code has gone away.


Javier Pello (6):
  elf: Remove legacy hwcaps support from the dynamic loader
  elf: Remove legacy hwcaps support from ldconfig
  elf: Remove hwcap parameter from add_to_cache signature
  elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  elf: Remove _dl_string_hwcap
  elf: Simplify output of hwcap subdirectories in ld.so help

 elf/cache.c                                   |  42 +---
 elf/dl-hwcaps.c                               | 180 +-----------------
 elf/dl-usage.c                                |  75 +-------
 elf/ldconfig.c                                | 150 +--------------
 sysdeps/alpha/dl-procinfo.h                   |   2 -
 sysdeps/csky/dl-procinfo.h                    |   2 -
 sysdeps/generic/dl-procinfo.h                 |   2 -
 sysdeps/generic/ldconfig.h                    |   2 +-
 sysdeps/mips/dl-procinfo.h                    |   2 -
 sysdeps/powerpc/dl-procinfo.h                 |  10 -
 sysdeps/s390/dl-procinfo.h                    |  14 --
 sysdeps/sparc/dl-procinfo.h                   |  13 --
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h |  12 --
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     |  12 --
 sysdeps/x86/dl-hwcap.h                        |  14 --
 15 files changed, 30 insertions(+), 502 deletions(-)

-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 1/6] elf: Remove legacy hwcaps support from the dynamic loader
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
@ 2022-09-14 18:08         ` Javier Pello
  2022-09-14 18:10         ` [PATCH 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
                           ` (6 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:08 UTC (permalink / raw)
  To: libc-alpha

Remove support for the legacy hwcaps subdirectories from the dynamic
loader.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-hwcaps.c | 180 ++----------------------------------------------
 elf/dl-usage.c  |  32 ---------
 2 files changed, 6 insertions(+), 206 deletions(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 92eb5379..0274a780 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -170,17 +170,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
 		      const char *glibc_hwcaps_mask,
 		      size_t *sz, size_t *max_capstrlen)
 {
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  /* Determine how many important bits are set.  */
-  uint64_t masked = GLRO(dl_hwcap) & hwcap_mask;
-  size_t cnt = GLRO (dl_platform) != NULL;
-  size_t n, m;
-  struct r_strlenpair *result;
-  struct r_strlenpair *rp;
-  char *cp;
-
-  /* glibc-hwcaps subdirectories.  These are exempted from the power
-     set construction below.  */
+  /* glibc-hwcaps subdirectories.  */
   uint32_t hwcaps_subdirs_active = _dl_hwcaps_subdirs_active ();
   struct hwcaps_counts hwcaps_counts =  { 0, };
   update_hwcaps_counts (&hwcaps_counts, glibc_hwcaps_prepend, -1, NULL);
@@ -193,72 +183,14 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
      and a "/" suffix once stored in the result.  */
   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
-  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
 		  + hwcaps_counts.total_length);
 
-  /* Count the number of bits set in the masked value.  */
-  for (n = 0; (~((1ULL << n) - 1) & masked) != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
-      ++cnt;
-
-  /* For TLS enabled builds always add 'tls'.  */
-  ++cnt;
-
-  /* Create temporary data structure to generate result table.  */
-  struct r_strlenpair temp[cnt];
-  m = 0;
-  for (n = 0; masked != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
-      {
-	temp[m].str = _dl_hwcap_string (n);
-	temp[m].len = strlen (temp[m].str);
-	masked ^= 1ULL << n;
-	++m;
-      }
-  if (GLRO (dl_platform) != NULL)
-    {
-      temp[m].str = GLRO (dl_platform);
-      temp[m].len = GLRO (dl_platformlen);
-      ++m;
-    }
-
-  temp[m].str = "tls";
-  temp[m].len = 3;
-  ++m;
+  *sz = hwcaps_counts.count;
 
-  assert (m == cnt);
-
-  /* Determine the total size of all strings together.  */
-  size_t total;
-  if (cnt == 1)
-    total = temp[0].len + 1;
-  else
-    {
-      total = temp[0].len + temp[cnt - 1].len + 2;
-      if (cnt > 2)
-	{
-	  total <<= 1;
-	  for (n = 1; n + 1 < cnt; ++n)
-	    total += temp[n].len + 1;
-	  if (cnt > 3
-	      && (cnt >= sizeof (size_t) * 8
-		  || total + (sizeof (*result) << 3)
-		     >= (1UL << (sizeof (size_t) * 8 - cnt + 3))))
-	    _dl_signal_error (ENOMEM, NULL, NULL,
-			      N_("cannot create capability list"));
-
-	  total <<= cnt - 3;
-	}
-    }
-
-  *sz = hwcaps_counts.count + (1 << cnt);
-
-  /* This is the overall result, including both glibc-hwcaps
-     subdirectories and the legacy hwcaps subdirectories using the
-     power set construction.  */
-  total += hwcaps_sz;
+  /* This is the overall result.  */
   struct r_strlenpair *overall_result
-    = malloc (*sz * sizeof (*result) + total);
+    = malloc (*sz * sizeof (*overall_result) + total);
   if (overall_result == NULL)
     _dl_signal_error (ENOMEM, NULL, NULL,
 		      N_("cannot create capability list"));
@@ -271,110 +203,10 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
     copy_hwcaps (&target, glibc_hwcaps_prepend, -1, NULL);
     copy_hwcaps (&target, _dl_hwcaps_subdirs,
 		 hwcaps_subdirs_active, glibc_hwcaps_mask);
-    /* Set up the write target for the power set construction.  */
-    result = target.next_pair;
-    cp = target.next_string;
   }
 
-
-  /* Power set construction begins here.  We use a very compressed way
-     to store the various combinations of capability names.  */
-
-  if (cnt == 1)
-    {
-      result[0].str = cp;
-      result[0].len = temp[0].len + 1;
-      result[1].str = cp;
-      result[1].len = 0;
-      cp = __mempcpy (cp, temp[0].str, temp[0].len);
-      *cp = '/';
-      if (result[0].len > hwcaps_counts.maximum_length)
-	*max_capstrlen = result[0].len;
-      else
-	*max_capstrlen = hwcaps_counts.maximum_length;
-
-      return overall_result;
-    }
-
-  /* Fill in the information.  This follows the following scheme
-     (indices from TEMP for four strings):
-	entry #0: 0, 1, 2, 3	binary: 1111
-	      #1: 0, 1, 3		1101
-	      #2: 0, 2, 3		1011
-	      #3: 0, 3			1001
-     This allows the representation of all possible combinations of
-     capability names in the string.  First generate the strings.  */
-  result[1].str = result[0].str = cp;
-#define add(idx) \
-      cp = __mempcpy (__mempcpy (cp, temp[idx].str, temp[idx].len), "/", 1);
-  if (cnt == 2)
-    {
-      add (1);
-      add (0);
-    }
-  else
-    {
-      n = 1 << (cnt - 1);
-      do
-	{
-	  n -= 2;
-
-	  /* We always add the last string.  */
-	  add (cnt - 1);
-
-	  /* Add the strings which have the bit set in N.  */
-	  for (m = cnt - 2; m > 0; --m)
-	    if ((n & (1 << m)) != 0)
-	      add (m);
-
-	  /* Always add the first string.  */
-	  add (0);
-	}
-      while (n != 0);
-    }
-#undef add
-
-  /* Now we are ready to install the string pointers and length.  */
-  for (n = 0; n < (1UL << cnt); ++n)
-    result[n].len = 0;
-  n = cnt;
-  do
-    {
-      size_t mask = 1 << --n;
-
-      rp = result;
-      for (m = 1 << cnt; m > 0; ++rp)
-	if ((--m & mask) != 0)
-	  rp->len += temp[n].len + 1;
-    }
-  while (n != 0);
-
-  /* The first half of the strings all include the first string.  */
-  n = (1 << cnt) - 2;
-  rp = &result[2];
-  while (n != (1UL << (cnt - 1)))
-    {
-      if ((--n & 1) != 0)
-	rp[0].str = rp[-2].str + rp[-2].len;
-      else
-	rp[0].str = rp[-1].str;
-      ++rp;
-    }
-
-  /* The second half starts right after the first part of the string of
-     the corresponding entry in the first half.  */
-  do
-    {
-      rp[0].str = rp[-(1 << (cnt - 1))].str + temp[cnt - 1].len + 1;
-      ++rp;
-    }
-  while (--n != 0);
-
   /* The maximum string length.  */
-  if (result[0].len > hwcaps_counts.maximum_length)
-    *max_capstrlen = result[0].len;
-  else
-    *max_capstrlen = hwcaps_counts.maximum_length;
+  *max_capstrlen = hwcaps_counts.maximum_length;
 
   return overall_result;
 }
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index 98d8c989..efd6c77c 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -193,37 +193,6 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
 No subdirectories of glibc-hwcaps directories are searched.\n");
 }
 
-/* Write a list of hwcap subdirectories to standard output.  See
- _dl_important_hwcaps in dl-hwcaps.c.  */
-static void
-print_legacy_hwcap_directories (void)
-{
-  _dl_printf ("\n\
-Legacy HWCAP subdirectories under library search path directories:\n");
-
-  const char *platform = GLRO (dl_platform);
-  if (platform != NULL)
-    _dl_printf ("  %s (AT_PLATFORM; supported, searched)\n", platform);
-
-  _dl_printf ("  tls (supported, searched)\n");
-
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  uint64_t searched = GLRO (dl_hwcap) & hwcap_mask;
-  for (int n = 63; n >= 0; --n)
-    {
-      uint64_t bit = 1ULL << n;
-      if (HWCAP_IMPORTANT & bit)
-        {
-          _dl_printf ("  %s", _dl_hwcap_string (n));
-          bool first = true;
-          print_hwcap_1 (&first, GLRO (dl_hwcap) & bit, "supported");
-          print_hwcap_1 (&first, !(hwcap_mask & bit), "masked");
-          print_hwcap_1 (&first, searched & bit, "searched");
-          print_hwcap_1_finish (&first);
-        }
-    }
-}
-
 void
 _dl_help (const char *argv0, struct dl_main_state *state)
 {
@@ -270,6 +239,5 @@ This program interpreter self-identifies as: " RTLD "\n\
               argv0);
   print_search_path_for_help (state);
   print_hwcaps_subdirectories (state);
-  print_legacy_hwcap_directories ();
   _exit (EXIT_SUCCESS);
 }
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 2/6] elf: Remove legacy hwcaps support from ldconfig
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
  2022-09-14 18:08         ` [PATCH 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
@ 2022-09-14 18:10         ` Javier Pello
  2022-09-14 18:10         ` [PATCH 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
                           ` (5 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:10 UTC (permalink / raw)
  To: libc-alpha

Remove support for the legacy hwcaps subdirectories from ldconfig.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/ldconfig.c | 149 +++----------------------------------------------
 1 file changed, 8 insertions(+), 141 deletions(-)

diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 6f37f38f..9399c228 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -46,16 +46,6 @@
 
 #include <dl-procinfo.h>
 
-/* This subpath in search path entries is always supported and
-   included in the cache for backwards compatibility.  */
-#define TLS_SUBPATH "tls"
-
-/* The MSB of the hwcap field is set for objects in TLS_SUBPATH
-   directories.  There is always TLS support in glibc, so the dynamic
-   loader does not check the bit directly.  But more hwcap bits make a
-   an object more preferred, so the bit still has meaning.  */
-#define TLS_HWCAP_BIT 63
-
 #ifndef LD_SO_CONF
 # define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
 #endif
@@ -120,9 +110,6 @@ static char *cache_file;
 /* Configuration file.  */
 static const char *config_file;
 
-/* Mask to use for important hardware capabilities.  */
-static unsigned long int hwcap_mask = HWCAP_IMPORTANT;
-
 /* Name and version of program.  */
 static void print_version (FILE *stream, struct argp_state *state);
 void (*argp_program_version_hook) (FILE *, struct argp_state *)
@@ -163,75 +150,6 @@ static struct argp argp =
   options, parse_opt, NULL, doc, NULL, more_help, NULL
 };
 
-/* Check if string corresponds to an important hardware capability or
-   a platform.  */
-static int
-is_hwcap_platform (const char *name)
-{
-  int hwcap_idx = _dl_string_hwcap (name);
-
-  /* Is this a normal hwcap for the machine like "fpu?"  */
-  if (hwcap_idx != -1 && ((1 << hwcap_idx) & hwcap_mask))
-    return 1;
-
-  /* Is this a platform pseudo-hwcap like "i686?"  */
-  hwcap_idx = _dl_string_platform (name);
-  if (hwcap_idx != -1)
-    return 1;
-
-  /* Backwards-compatibility for the "tls" subdirectory.  */
-  if (strcmp (name, TLS_SUBPATH) == 0)
-    return 1;
-
-  return 0;
-}
-
-/* Get hwcap (including platform) encoding of path.  */
-static uint64_t
-path_hwcap (const char *path)
-{
-  char *str = xstrdup (path);
-  char *ptr;
-  uint64_t hwcap = 0;
-  uint64_t h;
-
-  size_t len;
-
-  len = strlen (str);
-  if (str[len] == '/')
-    str[len] = '\0';
-
-  /* Search pathname from the end and check for hwcap strings.  */
-  for (;;)
-    {
-      ptr = strrchr (str, '/');
-
-      if (ptr == NULL)
-	break;
-
-      h = _dl_string_hwcap (ptr + 1);
-
-      if (h == (uint64_t) -1)
-	{
-	  h = _dl_string_platform (ptr + 1);
-	  if (h == (uint64_t) -1)
-	    {
-	      if (strcmp (ptr + 1, TLS_SUBPATH) == 0)
-		h = TLS_HWCAP_BIT;
-	      else
-		break;
-	    }
-	}
-      hwcap += 1ULL << h;
-
-      /* Search the next part of the path.  */
-      *ptr = '\0';
-    }
-
-  free (str);
-  return hwcap;
-}
-
 /* Handle program arguments.  */
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
@@ -747,27 +665,15 @@ struct dlib_entry
 static void
 search_dir (const struct dir_entry *entry)
 {
-  uint64_t hwcap;
-  if (entry->hwcaps == NULL)
-    {
-      hwcap = path_hwcap (entry->path);
-      if (opt_verbose)
-	{
-	  if (hwcap != 0)
-	    printf ("%s: (hwcap: %#.16" PRIx64 ")", entry->path, hwcap);
-	  else
-	    printf ("%s:", entry->path);
-	}
-    }
-  else
+  if (opt_verbose)
     {
-      hwcap = 0;
-      if (opt_verbose)
+      if (entry->hwcaps == NULL)
+	printf ("%s:", entry->path);
+      else
 	printf ("%s: (hwcap: \"%s\")", entry->path,
 		glibc_hwcaps_subdirectory_name (entry->hwcaps));
+      printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
     }
-  if (opt_verbose)
-    printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
 
   char *dir_name;
   char *real_file_name;
@@ -813,9 +719,7 @@ search_dir (const struct dir_entry *entry)
 	 subdirectory)?  The dynamic linker is also considered as
 	 shared library.  */
       if (!_dl_is_dso (direntry->d_name)
-	  && (direntry->d_type == DT_REG
-	      || (entry->hwcaps == NULL
-		  && !is_hwcap_platform (direntry->d_name))))
+	  && (direntry->d_type == DT_REG || entry->hwcaps == NULL))
 	continue;
 
       size_t len = strlen (direntry->d_name);
@@ -863,7 +767,6 @@ search_dir (const struct dir_entry *entry)
 	  }
 
       struct stat stat_buf;
-      bool is_dir;
       int is_link = S_ISLNK (lstat_buf.st_mode);
       if (is_link)
 	{
@@ -898,37 +801,13 @@ search_dir (const struct dir_entry *entry)
 	  if (opt_chroot != NULL)
 	    free (target_name);
 
-	  is_dir = S_ISDIR (stat_buf.st_mode);
-
 	  /* lstat_buf is later stored, update contents.  */
 	  lstat_buf.st_dev = stat_buf.st_dev;
 	  lstat_buf.st_ino = stat_buf.st_ino;
 	  lstat_buf.st_size = stat_buf.st_size;
 	  lstat_buf.st_ctime = stat_buf.st_ctime;
 	}
-      else
-	is_dir = S_ISDIR (lstat_buf.st_mode);
-
-      /* No descending into subdirectories if this directory is a
-	 glibc-hwcaps subdirectory (which are not recursive).  */
-      if (entry->hwcaps == NULL
-	  && is_dir && is_hwcap_platform (direntry->d_name))
-	{
-	  if (!is_link
-	      && direntry->d_type != DT_UNKNOWN
-	      && __builtin_expect (lstat (real_file_name, &lstat_buf), 0))
-	    {
-	      error (0, errno, _("Cannot lstat %s"), file_name);
-	      continue;
-	    }
-
-	  /* Handle subdirectory later.  */
-	  struct dir_entry *new_entry = new_sub_entry (entry, file_name,
-						       &lstat_buf);
-	  add_single_dir (new_entry, 0);
-	  continue;
-	}
-      else if (!S_ISREG (lstat_buf.st_mode) && !is_link)
+      else if (!S_ISREG (lstat_buf.st_mode))
 	continue;
 
       char *real_name;
@@ -1103,7 +982,7 @@ search_dir (const struct dir_entry *entry)
 	}
       if (opt_build_cache)
 	add_to_cache (entry->path, filename, dlib_ptr->soname,
-		      dlib_ptr->flag, dlib_ptr->isa_level, hwcap,
+		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
 		      entry->hwcaps);
     }
 
@@ -1290,16 +1169,6 @@ parse_conf_include (const char *config_file, unsigned int lineno,
   free (copy);
 }
 
-/* Honour LD_HWCAP_MASK.  */
-static void
-set_hwcap (void)
-{
-  char *mask = getenv ("LD_HWCAP_MASK");
-
-  if (mask)
-    hwcap_mask = strtoul (mask, NULL, 0);
-}
-
 
 int
 main (int argc, char **argv)
@@ -1332,8 +1201,6 @@ main (int argc, char **argv)
 	  add_dir_1 (argv[i], "<cmdline>", 0);
     }
 
-  set_hwcap ();
-
   if (opt_chroot != NULL)
     {
       /* Normalize the path a bit, we might need it for printing later.  */
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 3/6] elf: Remove hwcap parameter from add_to_cache signature
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
  2022-09-14 18:08         ` [PATCH 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
  2022-09-14 18:10         ` [PATCH 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
@ 2022-09-14 18:10         ` Javier Pello
  2022-09-14 18:12         ` [PATCH 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
                           ` (4 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:10 UTC (permalink / raw)
  To: libc-alpha

Last commit made it so that the value passed for that parameter was
always 0 at its only call site.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/cache.c                | 16 +++-------------
 elf/ldconfig.c             |  3 +--
 sysdeps/generic/ldconfig.h |  2 +-
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/elf/cache.c b/elf/cache.c
index f5f3ef8c..ecbea2a0 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -764,7 +764,7 @@ save_cache (const char *cache_name)
 /* Add one library to the cache.  */
 void
 add_to_cache (const char *path, const char *filename, const char *soname,
-	      int flags, unsigned int isa_level, uint64_t hwcap,
+	      int flags, unsigned int isa_level,
 	      struct glibc_hwcaps_subdirectory *hwcaps)
 {
   struct cache_entry *new_entry = xmalloc (sizeof (*new_entry));
@@ -782,22 +782,12 @@ add_to_cache (const char *path, const char *filename, const char *soname,
   new_entry->path = path_interned;
   new_entry->flags = flags;
   new_entry->isa_level = isa_level;
-  new_entry->hwcap = hwcap;
+  new_entry->hwcap = 0;
   new_entry->hwcaps = hwcaps;
   new_entry->bits_hwcap = 0;
 
   if (hwcaps != NULL)
-    {
-      assert (hwcap == 0);
-      hwcaps->used = true;
-    }
-
-  /* Count the number of bits set in the masked value.  */
-  for (size_t i = 0;
-       (~((1ULL << i) - 1) & hwcap) != 0 && i < 8 * sizeof (hwcap); ++i)
-    if ((hwcap & (1ULL << i)) != 0)
-      ++new_entry->bits_hwcap;
-
+    hwcaps->used = true;
 
   /* Keep the list sorted - search for right place to insert.  */
   struct cache_entry *ptr = entries;
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 9399c228..56325c6c 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -982,8 +982,7 @@ search_dir (const struct dir_entry *entry)
 	}
       if (opt_build_cache)
 	add_to_cache (entry->path, filename, dlib_ptr->soname,
-		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
-		      entry->hwcaps);
+		      dlib_ptr->flag, dlib_ptr->isa_level, entry->hwcaps);
     }
 
   /* Free all resources.  */
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db..24222b0f 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -70,7 +70,7 @@ const char *glibc_hwcaps_subdirectory_name
 
 extern void add_to_cache (const char *path, const char *filename,
 			  const char *soname, int flags,
-			  unsigned int isa_level, uint64_t hwcap,
+			  unsigned int isa_level,
 			  struct glibc_hwcaps_subdirectory *);
 
 extern void init_aux_cache (void);
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
                           ` (2 preceding siblings ...)
  2022-09-14 18:10         ` [PATCH 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
@ 2022-09-14 18:12         ` Javier Pello
  2022-09-14 18:13         ` [PATCH 5/6] elf: Remove _dl_string_hwcap Javier Pello
                           ` (3 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:12 UTC (permalink / raw)
  To: libc-alpha

They were set to 0 on initialisation and never changed later after
last commit.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/cache.c | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/elf/cache.c b/elf/cache.c
index ecbea2a0..10e61ae4 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -145,10 +145,8 @@ struct cache_entry
   struct stringtable_entry *path; /* Path to find library.  */
   int flags;			/* Flags to indicate kind of library.  */
   unsigned int isa_level;	/* Required ISA level.  */
-  uint64_t hwcap;		/* Important hardware capabilities.  */
-  int bits_hwcap;		/* Number of bits set in hwcap.  */
 
-  /* glibc-hwcaps subdirectory.  If not NULL, hwcap must be zero.  */
+  /* glibc-hwcaps subdirectory.  */
   struct glibc_hwcaps_subdirectory *hwcaps;
 
   struct cache_entry *next;	/* Next entry in list.  */
@@ -433,15 +431,6 @@ compare (const struct cache_entry *e1, const struct cache_entry *e2)
 	  if (res != 0)
 	    return res;
 	}
-      /* Sort by most specific hwcap.  */
-      if (e2->bits_hwcap > e1->bits_hwcap)
-	return 1;
-      else if (e2->bits_hwcap < e1->bits_hwcap)
-	return -1;
-      else if (e2->hwcap > e1->hwcap)
-	return 1;
-      else if (e2->hwcap < e1->hwcap)
-	return -1;
     }
   return res;
 }
@@ -547,14 +536,13 @@ save_cache (const char *cache_name)
   int cache_entry_count = 0;
   /* The old format doesn't contain hwcap entries and doesn't contain
      libraries in subdirectories with hwcaps entries.  Count therefore
-     also all entries with hwcap == 0.  */
+     all entries.  */
   int cache_entry_old_count = 0;
 
   for (entry = entries; entry != NULL; entry = entry->next)
     {
       ++cache_entry_count;
-      if (entry->hwcap == 0)
-	++cache_entry_old_count;
+      ++cache_entry_old_count;
     }
 
   struct stringtable_finalized strings_finalized;
@@ -626,7 +614,7 @@ save_cache (const char *cache_name)
   for (idx_old = 0, idx_new = 0, entry = entries; entry != NULL;
        entry = entry->next, ++idx_new)
     {
-      if (opt_format != opt_format_new && entry->hwcap == 0)
+      if (opt_format != opt_format_new)
 	{
 	  file_entries->libs[idx_old].flags = entry->flags;
 	  /* XXX: Actually we can optimize here and remove duplicates.  */
@@ -644,7 +632,7 @@ save_cache (const char *cache_name)
 	  file_entries_new->libs[idx_new].flags = entry->flags;
 	  file_entries_new->libs[idx_new].osversion_unused = 0;
 	  if (entry->hwcaps == NULL)
-	    file_entries_new->libs[idx_new].hwcap = entry->hwcap;
+	    file_entries_new->libs[idx_new].hwcap = 0;
 	  else
 	    file_entries_new->libs[idx_new].hwcap
 	      = compute_hwcap_value (entry);
@@ -654,9 +642,7 @@ save_cache (const char *cache_name)
 	    = str_offset + entry->path->offset;
 	}
 
-      /* Ignore entries with hwcap for old format.  */
-      if (entry->hwcap == 0)
-	++idx_old;
+      ++idx_old;
     }
 
   /* Duplicate last old cache entry if needed.  */
@@ -782,9 +768,7 @@ add_to_cache (const char *path, const char *filename, const char *soname,
   new_entry->path = path_interned;
   new_entry->flags = flags;
   new_entry->isa_level = isa_level;
-  new_entry->hwcap = 0;
   new_entry->hwcaps = hwcaps;
-  new_entry->bits_hwcap = 0;
 
   if (hwcaps != NULL)
     hwcaps->used = true;
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 5/6] elf: Remove _dl_string_hwcap
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
                           ` (3 preceding siblings ...)
  2022-09-14 18:12         ` [PATCH 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
@ 2022-09-14 18:13         ` Javier Pello
  2022-09-14 18:15         ` [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
                           ` (2 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:13 UTC (permalink / raw)
  To: libc-alpha

Removal of legacy hwcaps support from the dynamic loader left
no users of _dl_string_hwcap.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 sysdeps/alpha/dl-procinfo.h                   |  2 --
 sysdeps/csky/dl-procinfo.h                    |  2 --
 sysdeps/generic/dl-procinfo.h                 |  2 --
 sysdeps/mips/dl-procinfo.h                    |  2 --
 sysdeps/powerpc/dl-procinfo.h                 | 10 ----------
 sysdeps/s390/dl-procinfo.h                    | 14 --------------
 sysdeps/sparc/dl-procinfo.h                   | 13 -------------
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h | 12 ------------
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     | 12 ------------
 sysdeps/x86/dl-hwcap.h                        | 14 --------------
 10 files changed, 83 deletions(-)

diff --git a/sysdeps/alpha/dl-procinfo.h b/sysdeps/alpha/dl-procinfo.h
index 31630fbb..6a12297d 100644
--- a/sysdeps/alpha/dl-procinfo.h
+++ b/sysdeps/alpha/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/csky/dl-procinfo.h b/sysdeps/csky/dl-procinfo.h
index d29e19a9..5da90087 100644
--- a/sysdeps/csky/dl-procinfo.h
+++ b/sysdeps/csky/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h
index 8f736e1d..033bcb3e 100644
--- a/sysdeps/generic/dl-procinfo.h
+++ b/sysdeps/generic/dl-procinfo.h
@@ -34,8 +34,6 @@
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT 0
 
-#define _dl_string_hwcap(str) (-1)
-
 #define _dl_string_platform(str) (-1)
 
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/mips/dl-procinfo.h b/sysdeps/mips/dl-procinfo.h
index 619dc089..25127c36 100644
--- a/sysdeps/mips/dl-procinfo.h
+++ b/sysdeps/mips/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 6ed15610..a0b2d779 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -69,16 +69,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_powerpc_cap_flags)[idx];
 }
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
-    if (strcmp (str, _dl_hwcap_string (i)) == 0)
-      return i;
-  return -1;
-}
-
 static inline int
 __attribute__ ((unused, always_inline))
 _dl_string_platform (const char *str)
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
index e1f88b9a..73aad1fd 100644
--- a/sysdeps/s390/dl-procinfo.h
+++ b/sysdeps/s390/dl-procinfo.h
@@ -83,20 +83,6 @@ _dl_hwcap_string (int idx)
   return _dl_s390_cap_flags[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-
-  for (i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_s390_cap_flags[i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 static inline int
 __attribute__ ((unused, always_inline))
 _dl_string_platform (const char *str)
diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
index 4a723b53..fa095832 100644
--- a/sysdeps/sparc/dl-procinfo.h
+++ b/sysdeps/sparc/dl-procinfo.h
@@ -52,19 +52,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_sparc_cap_flags)[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-  for (i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, GLRO(dl_sparc_cap_flags) [i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 #include <bits/wordsize.h>
 #define HWCAP_IMPORTANT_V9	(__WORDSIZE == 64 ? 0 : HWCAP_SPARC_V9)
 #define HWCAP_IMPORTANT		(HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index aa505223..f7382f63 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -37,18 +37,6 @@ _dl_hwcap_string (int idx)
   return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
 };
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_hwcap_string (i)) == 0)
-	return i;
-    }
-  return -1;
-};
-
 /* There're no platforms to filter out.  */
 #define _DL_HWCAP_PLATFORM 0
 
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
index 1f4c8c3a..d8c0f262 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
@@ -75,18 +75,6 @@ _dl_procinfo (unsigned int type, unsigned long int word)
 
 #define HWCAP_IMPORTANT		(HWCAP_ARM_VFP | HWCAP_ARM_NEON)
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_hwcap_string (i)) == 0)
-	return i;
-    }
-  return -1;
-};
-
 #define _dl_string_platform(str) (-1)
 
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/x86/dl-hwcap.h b/sysdeps/x86/dl-hwcap.h
index 26790afc..1313cecd 100644
--- a/sysdeps/x86/dl-hwcap.h
+++ b/sysdeps/x86/dl-hwcap.h
@@ -57,20 +57,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_x86_hwcap_flags)[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-
-  for (i = HWCAP_START; i < HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, GLRO(dl_x86_hwcap_flags)[i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 /* We cannot provide a general printing function.  */
 #define _dl_procinfo(type, word) -1
 
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
                           ` (4 preceding siblings ...)
  2022-09-14 18:13         ` [PATCH 5/6] elf: Remove _dl_string_hwcap Javier Pello
@ 2022-09-14 18:15         ` Javier Pello
  2022-09-15  8:42           ` Carlos O'Donell
  2022-09-14 21:23         ` [PATCH 0/6] Remove legacy hwcaps support Joseph Myers
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-14 18:15 UTC (permalink / raw)
  To: libc-alpha

The print_hwcap_1 machinery was useful for the legacy hwcaps
subdirectories, but it is not worth the trouble now that they
are gone.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-usage.c | 43 +++++++------------------------------------
 1 file changed, 7 insertions(+), 36 deletions(-)

diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index efd6c77c..754a6391 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state)
   print_search_path_for_help_1 (__rtld_search_dirs.dirs);
 }
 
-/* Helper function for printing flags associated with a HWCAP name.  */
-static void
-print_hwcap_1 (bool *first, bool active, const char *label)
-{
-  if (active)
-    {
-      if (*first)
-        {
-          _dl_printf (" (");
-          *first = false;
-        }
-      else
-        _dl_printf (", ");
-      _dl_printf ("%s", label);
-    }
-}
-
-/* Called after a series of print_hwcap_1 calls to emit the line
-   terminator.  */
-static void
-print_hwcap_1_finish (bool *first)
-{
-  if (*first)
-    _dl_printf ("\n");
-  else
-    _dl_printf (")\n");
-}
-
 /* Print the header for print_hwcaps_subdirectories.  */
 static void
 print_hwcaps_subdirectories_header (bool *nothing_printed)
@@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
     {
       print_hwcaps_subdirectories_header (&nothing_printed);
       print_hwcaps_subdirectories_name (&split);
-      bool first = true;
-      print_hwcap_1 (&first, true, "searched");
-      print_hwcap_1_finish (&first);
+      _dl_printf (" (searched)\n");
     }
 
   /* The built-in glibc-hwcaps subdirectories.  Do the filtering
@@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
     {
       print_hwcaps_subdirectories_header (&nothing_printed);
       print_hwcaps_subdirectories_name (&split);
-      bool first = true;
-      print_hwcap_1 (&first, mask & 1, "supported");
       bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask,
                                          split.segment, split.length);
-      print_hwcap_1 (&first, !listed, "masked");
-      print_hwcap_1 (&first, (mask & 1) && listed, "searched");
-      print_hwcap_1_finish (&first);
+      if (mask & 1)
+        _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked");
+      else if (!listed)
+        _dl_printf (" (masked)\n");
+      else
+        _dl_printf ("\n");
       mask >>= 1;
     }
 
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 0/6] Remove legacy hwcaps support
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
                           ` (5 preceding siblings ...)
  2022-09-14 18:15         ` [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
@ 2022-09-14 21:23         ` Joseph Myers
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
  7 siblings, 0 replies; 53+ messages in thread
From: Joseph Myers @ 2022-09-14 21:23 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

I think this needs a NEWS entry for the removal.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help
  2022-09-14 18:15         ` [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
@ 2022-09-15  8:42           ` Carlos O'Donell
  2022-09-15 19:12             ` Javier Pello
  0 siblings, 1 reply; 53+ messages in thread
From: Carlos O'Donell @ 2022-09-15  8:42 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

On Wed, Sep 14, 2022 at 08:15:09PM +0200, Javier Pello wrote:
> The print_hwcap_1 machinery was useful for the legacy hwcaps
> subdirectories, but it is not worth the trouble now that they
> are gone.

This fails pre-commit CI for i686:
https://patchwork.sourceware.org/project/glibc/patch/20220914201509.1c642836df76f95d3c2a8f28@otheo.eu/

Which architectures have you tested this on?

> Signed-off-by: Javier Pello <devel@otheo.eu>
> ---
>  elf/dl-usage.c | 43 +++++++------------------------------------
>  1 file changed, 7 insertions(+), 36 deletions(-)
> 
> diff --git a/elf/dl-usage.c b/elf/dl-usage.c
> index efd6c77c..754a6391 100644
> --- a/elf/dl-usage.c
> +++ b/elf/dl-usage.c
> @@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state)
>    print_search_path_for_help_1 (__rtld_search_dirs.dirs);
>  }
>  
> -/* Helper function for printing flags associated with a HWCAP name.  */
> -static void
> -print_hwcap_1 (bool *first, bool active, const char *label)
> -{
> -  if (active)
> -    {
> -      if (*first)
> -        {
> -          _dl_printf (" (");
> -          *first = false;
> -        }
> -      else
> -        _dl_printf (", ");
> -      _dl_printf ("%s", label);
> -    }
> -}
> -
> -/* Called after a series of print_hwcap_1 calls to emit the line
> -   terminator.  */
> -static void
> -print_hwcap_1_finish (bool *first)
> -{
> -  if (*first)
> -    _dl_printf ("\n");
> -  else
> -    _dl_printf (")\n");
> -}
> -
>  /* Print the header for print_hwcaps_subdirectories.  */
>  static void
>  print_hwcaps_subdirectories_header (bool *nothing_printed)
> @@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
>      {
>        print_hwcaps_subdirectories_header (&nothing_printed);
>        print_hwcaps_subdirectories_name (&split);
> -      bool first = true;
> -      print_hwcap_1 (&first, true, "searched");
> -      print_hwcap_1_finish (&first);
> +      _dl_printf (" (searched)\n");
>      }
>  
>    /* The built-in glibc-hwcaps subdirectories.  Do the filtering
> @@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
>      {
>        print_hwcaps_subdirectories_header (&nothing_printed);
>        print_hwcaps_subdirectories_name (&split);
> -      bool first = true;
> -      print_hwcap_1 (&first, mask & 1, "supported");
>        bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask,
>                                           split.segment, split.length);
> -      print_hwcap_1 (&first, !listed, "masked");
> -      print_hwcap_1 (&first, (mask & 1) && listed, "searched");
> -      print_hwcap_1_finish (&first);
> +      if (mask & 1)
> +        _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked");
> +      else if (!listed)
> +        _dl_printf (" (masked)\n");
> +      else
> +        _dl_printf ("\n");
>        mask >>= 1;
>      }
>  
> -- 
> 2.36.0
> 


^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help
  2022-09-15  8:42           ` Carlos O'Donell
@ 2022-09-15 19:12             ` Javier Pello
  0 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-15 19:12 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: libc-alpha

On Thu, 15 Sep 2022 04:42:36 -0400, Carlos O'Donell wrote:

> On Wed, Sep 14, 2022 at 08:15:09PM +0200, Javier Pello wrote:
> > The print_hwcap_1 machinery was useful for the legacy hwcaps
> > subdirectories, but it is not worth the trouble now that they
> > are gone.
> 
> This fails pre-commit CI for i686:
> https://patchwork.sourceware.org/project/glibc/patch/20220914201509.1c642836df76f95d3c2a8f28@otheo.eu/

And spectacularly so, it seems.

> Which architectures have you tested this on?

On i686, ironically. And the output from make check looks fine on
my end.

I am puzzled. The output from CI suggests that the compiled libc.so
cannot be loaded, but the last patch only inlines two static
functions, only used for the output of ld.so --help. I cannot see
why the patch series would be fine after patch 5 but fail this way
after patch 6.

I will try to look into this.

Javier

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 0/6] Remove legacy hwcaps support
  2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
                           ` (6 preceding siblings ...)
  2022-09-14 21:23         ` [PATCH 0/6] Remove legacy hwcaps support Joseph Myers
@ 2022-09-17 14:17         ` Javier Pello
  2022-09-17 14:18           ` [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
                             ` (7 more replies)
  7 siblings, 8 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:17 UTC (permalink / raw)
  To: libc-alpha

Here is an updated version. The problem was in the first patch, not
the last one--I guess that I misunderstood the output from CI. The
patch removed _all_ of the power set subdirectories from the search
path, but the base subdirectory (no bits set) has to be preserved,
because it is not added anywhere else.


Javier Pello (6):
  elf: Remove legacy hwcaps support from the dynamic loader
  elf: Remove legacy hwcaps support from ldconfig
  elf: Remove hwcap parameter from add_to_cache signature
  elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  elf: Remove _dl_string_hwcap
  elf: Simplify output of hwcap subdirectories in ld.so help

 elf/Makefile                                  |   6 -
 elf/cache.c                                   |  42 +---
 elf/dl-hwcaps.c                               | 184 +-----------------
 elf/dl-usage.c                                |  75 +------
 elf/ldconfig.c                                | 150 +-------------
 sysdeps/alpha/dl-procinfo.h                   |   2 -
 sysdeps/csky/dl-procinfo.h                    |   2 -
 sysdeps/generic/dl-procinfo.h                 |   2 -
 sysdeps/generic/ldconfig.h                    |   2 +-
 sysdeps/mips/dl-procinfo.h                    |   2 -
 sysdeps/powerpc/dl-procinfo.h                 |  10 -
 sysdeps/s390/dl-procinfo.h                    |  14 --
 sysdeps/sparc/dl-procinfo.h                   |  13 --
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h |  12 --
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     |  12 --
 sysdeps/x86/dl-hwcap.h                        |  14 --
 16 files changed, 34 insertions(+), 508 deletions(-)

-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
@ 2022-09-17 14:18           ` Javier Pello
  2022-09-22 11:46             ` Florian Weimer
  2022-09-17 14:19           ` [PATCH v2 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
                             ` (6 subsequent siblings)
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:18 UTC (permalink / raw)
  To: libc-alpha

Remove support for the legacy hwcaps subdirectories from the dynamic
loader.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/Makefile    |   6 --
 elf/dl-hwcaps.c | 184 +++---------------------------------------------
 elf/dl-usage.c  |  32 ---------
 3 files changed, 10 insertions(+), 212 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index 008770bf..276343a4 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -2689,12 +2689,6 @@ $(objpfx)tst-rtld-help.out: $(objpfx)ld.so
 	$(test-wrapper) $(rtld-prefix) --help > $@; \
 	status=$$?; \
 	echo "info: ld.so exit status: $$status" >> $@; \
-	if ! grep -q 'Legacy HWCAP subdirectories under library search path directories' $@; then \
-	  echo "error: missing subdirectory pattern" >> $@; \
-	  if test $$status -eq 0; then \
-	    status=1; \
-	  fi; \
-	fi; \
 	(exit $$status); \
 	$(evaluate-test)
 
diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 92eb5379..ae2423eb 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -170,17 +170,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
 		      const char *glibc_hwcaps_mask,
 		      size_t *sz, size_t *max_capstrlen)
 {
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  /* Determine how many important bits are set.  */
-  uint64_t masked = GLRO(dl_hwcap) & hwcap_mask;
-  size_t cnt = GLRO (dl_platform) != NULL;
-  size_t n, m;
-  struct r_strlenpair *result;
-  struct r_strlenpair *rp;
-  char *cp;
-
-  /* glibc-hwcaps subdirectories.  These are exempted from the power
-     set construction below.  */
+  /* glibc-hwcaps subdirectories.  */
   uint32_t hwcaps_subdirs_active = _dl_hwcaps_subdirs_active ();
   struct hwcaps_counts hwcaps_counts =  { 0, };
   update_hwcaps_counts (&hwcaps_counts, glibc_hwcaps_prepend, -1, NULL);
@@ -193,72 +183,14 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
      and a "/" suffix once stored in the result.  */
   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
-  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
 		  + hwcaps_counts.total_length);
 
-  /* Count the number of bits set in the masked value.  */
-  for (n = 0; (~((1ULL << n) - 1) & masked) != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
-      ++cnt;
-
-  /* For TLS enabled builds always add 'tls'.  */
-  ++cnt;
-
-  /* Create temporary data structure to generate result table.  */
-  struct r_strlenpair temp[cnt];
-  m = 0;
-  for (n = 0; masked != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
-      {
-	temp[m].str = _dl_hwcap_string (n);
-	temp[m].len = strlen (temp[m].str);
-	masked ^= 1ULL << n;
-	++m;
-      }
-  if (GLRO (dl_platform) != NULL)
-    {
-      temp[m].str = GLRO (dl_platform);
-      temp[m].len = GLRO (dl_platformlen);
-      ++m;
-    }
-
-  temp[m].str = "tls";
-  temp[m].len = 3;
-  ++m;
-
-  assert (m == cnt);
-
-  /* Determine the total size of all strings together.  */
-  size_t total;
-  if (cnt == 1)
-    total = temp[0].len + 1;
-  else
-    {
-      total = temp[0].len + temp[cnt - 1].len + 2;
-      if (cnt > 2)
-	{
-	  total <<= 1;
-	  for (n = 1; n + 1 < cnt; ++n)
-	    total += temp[n].len + 1;
-	  if (cnt > 3
-	      && (cnt >= sizeof (size_t) * 8
-		  || total + (sizeof (*result) << 3)
-		     >= (1UL << (sizeof (size_t) * 8 - cnt + 3))))
-	    _dl_signal_error (ENOMEM, NULL, NULL,
-			      N_("cannot create capability list"));
-
-	  total <<= cnt - 3;
-	}
-    }
+  *sz = hwcaps_counts.count + 1;
 
-  *sz = hwcaps_counts.count + (1 << cnt);
-
-  /* This is the overall result, including both glibc-hwcaps
-     subdirectories and the legacy hwcaps subdirectories using the
-     power set construction.  */
-  total += hwcaps_sz;
+  /* This is the overall result.  */
   struct r_strlenpair *overall_result
-    = malloc (*sz * sizeof (*result) + total);
+    = malloc (*sz * sizeof (*overall_result) + total);
   if (overall_result == NULL)
     _dl_signal_error (ENOMEM, NULL, NULL,
 		      N_("cannot create capability list"));
@@ -271,110 +203,14 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
     copy_hwcaps (&target, glibc_hwcaps_prepend, -1, NULL);
     copy_hwcaps (&target, _dl_hwcaps_subdirs,
 		 hwcaps_subdirs_active, glibc_hwcaps_mask);
-    /* Set up the write target for the power set construction.  */
-    result = target.next_pair;
-    cp = target.next_string;
-  }
 
-
-  /* Power set construction begins here.  We use a very compressed way
-     to store the various combinations of capability names.  */
-
-  if (cnt == 1)
-    {
-      result[0].str = cp;
-      result[0].len = temp[0].len + 1;
-      result[1].str = cp;
-      result[1].len = 0;
-      cp = __mempcpy (cp, temp[0].str, temp[0].len);
-      *cp = '/';
-      if (result[0].len > hwcaps_counts.maximum_length)
-	*max_capstrlen = result[0].len;
-      else
-	*max_capstrlen = hwcaps_counts.maximum_length;
-
-      return overall_result;
-    }
-
-  /* Fill in the information.  This follows the following scheme
-     (indices from TEMP for four strings):
-	entry #0: 0, 1, 2, 3	binary: 1111
-	      #1: 0, 1, 3		1101
-	      #2: 0, 2, 3		1011
-	      #3: 0, 3			1001
-     This allows the representation of all possible combinations of
-     capability names in the string.  First generate the strings.  */
-  result[1].str = result[0].str = cp;
-#define add(idx) \
-      cp = __mempcpy (__mempcpy (cp, temp[idx].str, temp[idx].len), "/", 1);
-  if (cnt == 2)
-    {
-      add (1);
-      add (0);
-    }
-  else
-    {
-      n = 1 << (cnt - 1);
-      do
-	{
-	  n -= 2;
-
-	  /* We always add the last string.  */
-	  add (cnt - 1);
-
-	  /* Add the strings which have the bit set in N.  */
-	  for (m = cnt - 2; m > 0; --m)
-	    if ((n & (1 << m)) != 0)
-	      add (m);
-
-	  /* Always add the first string.  */
-	  add (0);
-	}
-      while (n != 0);
-    }
-#undef add
-
-  /* Now we are ready to install the string pointers and length.  */
-  for (n = 0; n < (1UL << cnt); ++n)
-    result[n].len = 0;
-  n = cnt;
-  do
-    {
-      size_t mask = 1 << --n;
-
-      rp = result;
-      for (m = 1 << cnt; m > 0; ++rp)
-	if ((--m & mask) != 0)
-	  rp->len += temp[n].len + 1;
-    }
-  while (n != 0);
-
-  /* The first half of the strings all include the first string.  */
-  n = (1 << cnt) - 2;
-  rp = &result[2];
-  while (n != (1UL << (cnt - 1)))
-    {
-      if ((--n & 1) != 0)
-	rp[0].str = rp[-2].str + rp[-2].len;
-      else
-	rp[0].str = rp[-1].str;
-      ++rp;
-    }
-
-  /* The second half starts right after the first part of the string of
-     the corresponding entry in the first half.  */
-  do
-    {
-      rp[0].str = rp[-(1 << (cnt - 1))].str + temp[cnt - 1].len + 1;
-      ++rp;
-    }
-  while (--n != 0);
+    /* Append an empty entry for the base directory itself.  */
+    target.next_pair->str = target.next_string;
+    target.next_pair->len = 0;
+  }
 
   /* The maximum string length.  */
-  if (result[0].len > hwcaps_counts.maximum_length)
-    *max_capstrlen = result[0].len;
-  else
-    *max_capstrlen = hwcaps_counts.maximum_length;
+  *max_capstrlen = hwcaps_counts.maximum_length;
 
   return overall_result;
 }
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index 98d8c989..efd6c77c 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -193,37 +193,6 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
 No subdirectories of glibc-hwcaps directories are searched.\n");
 }
 
-/* Write a list of hwcap subdirectories to standard output.  See
- _dl_important_hwcaps in dl-hwcaps.c.  */
-static void
-print_legacy_hwcap_directories (void)
-{
-  _dl_printf ("\n\
-Legacy HWCAP subdirectories under library search path directories:\n");
-
-  const char *platform = GLRO (dl_platform);
-  if (platform != NULL)
-    _dl_printf ("  %s (AT_PLATFORM; supported, searched)\n", platform);
-
-  _dl_printf ("  tls (supported, searched)\n");
-
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  uint64_t searched = GLRO (dl_hwcap) & hwcap_mask;
-  for (int n = 63; n >= 0; --n)
-    {
-      uint64_t bit = 1ULL << n;
-      if (HWCAP_IMPORTANT & bit)
-        {
-          _dl_printf ("  %s", _dl_hwcap_string (n));
-          bool first = true;
-          print_hwcap_1 (&first, GLRO (dl_hwcap) & bit, "supported");
-          print_hwcap_1 (&first, !(hwcap_mask & bit), "masked");
-          print_hwcap_1 (&first, searched & bit, "searched");
-          print_hwcap_1_finish (&first);
-        }
-    }
-}
-
 void
 _dl_help (const char *argv0, struct dl_main_state *state)
 {
@@ -270,6 +239,5 @@ This program interpreter self-identifies as: " RTLD "\n\
               argv0);
   print_search_path_for_help (state);
   print_hwcaps_subdirectories (state);
-  print_legacy_hwcap_directories ();
   _exit (EXIT_SUCCESS);
 }
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 2/6] elf: Remove legacy hwcaps support from ldconfig
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
  2022-09-17 14:18           ` [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
@ 2022-09-17 14:19           ` Javier Pello
  2022-09-22 12:14             ` Florian Weimer
  2022-09-17 14:20           ` [PATCH v2 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
                             ` (5 subsequent siblings)
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:19 UTC (permalink / raw)
  To: libc-alpha

Remove support for the legacy hwcaps subdirectories from ldconfig.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/ldconfig.c | 149 +++----------------------------------------------
 1 file changed, 8 insertions(+), 141 deletions(-)

diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 6f37f38f..9399c228 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -46,16 +46,6 @@
 
 #include <dl-procinfo.h>
 
-/* This subpath in search path entries is always supported and
-   included in the cache for backwards compatibility.  */
-#define TLS_SUBPATH "tls"
-
-/* The MSB of the hwcap field is set for objects in TLS_SUBPATH
-   directories.  There is always TLS support in glibc, so the dynamic
-   loader does not check the bit directly.  But more hwcap bits make a
-   an object more preferred, so the bit still has meaning.  */
-#define TLS_HWCAP_BIT 63
-
 #ifndef LD_SO_CONF
 # define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
 #endif
@@ -120,9 +110,6 @@ static char *cache_file;
 /* Configuration file.  */
 static const char *config_file;
 
-/* Mask to use for important hardware capabilities.  */
-static unsigned long int hwcap_mask = HWCAP_IMPORTANT;
-
 /* Name and version of program.  */
 static void print_version (FILE *stream, struct argp_state *state);
 void (*argp_program_version_hook) (FILE *, struct argp_state *)
@@ -163,75 +150,6 @@ static struct argp argp =
   options, parse_opt, NULL, doc, NULL, more_help, NULL
 };
 
-/* Check if string corresponds to an important hardware capability or
-   a platform.  */
-static int
-is_hwcap_platform (const char *name)
-{
-  int hwcap_idx = _dl_string_hwcap (name);
-
-  /* Is this a normal hwcap for the machine like "fpu?"  */
-  if (hwcap_idx != -1 && ((1 << hwcap_idx) & hwcap_mask))
-    return 1;
-
-  /* Is this a platform pseudo-hwcap like "i686?"  */
-  hwcap_idx = _dl_string_platform (name);
-  if (hwcap_idx != -1)
-    return 1;
-
-  /* Backwards-compatibility for the "tls" subdirectory.  */
-  if (strcmp (name, TLS_SUBPATH) == 0)
-    return 1;
-
-  return 0;
-}
-
-/* Get hwcap (including platform) encoding of path.  */
-static uint64_t
-path_hwcap (const char *path)
-{
-  char *str = xstrdup (path);
-  char *ptr;
-  uint64_t hwcap = 0;
-  uint64_t h;
-
-  size_t len;
-
-  len = strlen (str);
-  if (str[len] == '/')
-    str[len] = '\0';
-
-  /* Search pathname from the end and check for hwcap strings.  */
-  for (;;)
-    {
-      ptr = strrchr (str, '/');
-
-      if (ptr == NULL)
-	break;
-
-      h = _dl_string_hwcap (ptr + 1);
-
-      if (h == (uint64_t) -1)
-	{
-	  h = _dl_string_platform (ptr + 1);
-	  if (h == (uint64_t) -1)
-	    {
-	      if (strcmp (ptr + 1, TLS_SUBPATH) == 0)
-		h = TLS_HWCAP_BIT;
-	      else
-		break;
-	    }
-	}
-      hwcap += 1ULL << h;
-
-      /* Search the next part of the path.  */
-      *ptr = '\0';
-    }
-
-  free (str);
-  return hwcap;
-}
-
 /* Handle program arguments.  */
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
@@ -747,27 +665,15 @@ struct dlib_entry
 static void
 search_dir (const struct dir_entry *entry)
 {
-  uint64_t hwcap;
-  if (entry->hwcaps == NULL)
-    {
-      hwcap = path_hwcap (entry->path);
-      if (opt_verbose)
-	{
-	  if (hwcap != 0)
-	    printf ("%s: (hwcap: %#.16" PRIx64 ")", entry->path, hwcap);
-	  else
-	    printf ("%s:", entry->path);
-	}
-    }
-  else
+  if (opt_verbose)
     {
-      hwcap = 0;
-      if (opt_verbose)
+      if (entry->hwcaps == NULL)
+	printf ("%s:", entry->path);
+      else
 	printf ("%s: (hwcap: \"%s\")", entry->path,
 		glibc_hwcaps_subdirectory_name (entry->hwcaps));
+      printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
     }
-  if (opt_verbose)
-    printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
 
   char *dir_name;
   char *real_file_name;
@@ -813,9 +719,7 @@ search_dir (const struct dir_entry *entry)
 	 subdirectory)?  The dynamic linker is also considered as
 	 shared library.  */
       if (!_dl_is_dso (direntry->d_name)
-	  && (direntry->d_type == DT_REG
-	      || (entry->hwcaps == NULL
-		  && !is_hwcap_platform (direntry->d_name))))
+	  && (direntry->d_type == DT_REG || entry->hwcaps == NULL))
 	continue;
 
       size_t len = strlen (direntry->d_name);
@@ -863,7 +767,6 @@ search_dir (const struct dir_entry *entry)
 	  }
 
       struct stat stat_buf;
-      bool is_dir;
       int is_link = S_ISLNK (lstat_buf.st_mode);
       if (is_link)
 	{
@@ -898,37 +801,13 @@ search_dir (const struct dir_entry *entry)
 	  if (opt_chroot != NULL)
 	    free (target_name);
 
-	  is_dir = S_ISDIR (stat_buf.st_mode);
-
 	  /* lstat_buf is later stored, update contents.  */
 	  lstat_buf.st_dev = stat_buf.st_dev;
 	  lstat_buf.st_ino = stat_buf.st_ino;
 	  lstat_buf.st_size = stat_buf.st_size;
 	  lstat_buf.st_ctime = stat_buf.st_ctime;
 	}
-      else
-	is_dir = S_ISDIR (lstat_buf.st_mode);
-
-      /* No descending into subdirectories if this directory is a
-	 glibc-hwcaps subdirectory (which are not recursive).  */
-      if (entry->hwcaps == NULL
-	  && is_dir && is_hwcap_platform (direntry->d_name))
-	{
-	  if (!is_link
-	      && direntry->d_type != DT_UNKNOWN
-	      && __builtin_expect (lstat (real_file_name, &lstat_buf), 0))
-	    {
-	      error (0, errno, _("Cannot lstat %s"), file_name);
-	      continue;
-	    }
-
-	  /* Handle subdirectory later.  */
-	  struct dir_entry *new_entry = new_sub_entry (entry, file_name,
-						       &lstat_buf);
-	  add_single_dir (new_entry, 0);
-	  continue;
-	}
-      else if (!S_ISREG (lstat_buf.st_mode) && !is_link)
+      else if (!S_ISREG (lstat_buf.st_mode))
 	continue;
 
       char *real_name;
@@ -1103,7 +982,7 @@ search_dir (const struct dir_entry *entry)
 	}
       if (opt_build_cache)
 	add_to_cache (entry->path, filename, dlib_ptr->soname,
-		      dlib_ptr->flag, dlib_ptr->isa_level, hwcap,
+		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
 		      entry->hwcaps);
     }
 
@@ -1290,16 +1169,6 @@ parse_conf_include (const char *config_file, unsigned int lineno,
   free (copy);
 }
 
-/* Honour LD_HWCAP_MASK.  */
-static void
-set_hwcap (void)
-{
-  char *mask = getenv ("LD_HWCAP_MASK");
-
-  if (mask)
-    hwcap_mask = strtoul (mask, NULL, 0);
-}
-
 
 int
 main (int argc, char **argv)
@@ -1332,8 +1201,6 @@ main (int argc, char **argv)
 	  add_dir_1 (argv[i], "<cmdline>", 0);
     }
 
-  set_hwcap ();
-
   if (opt_chroot != NULL)
     {
       /* Normalize the path a bit, we might need it for printing later.  */
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 3/6] elf: Remove hwcap parameter from add_to_cache signature
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
  2022-09-17 14:18           ` [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
  2022-09-17 14:19           ` [PATCH v2 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
@ 2022-09-17 14:20           ` Javier Pello
  2022-09-22 16:02             ` Florian Weimer
  2022-09-17 14:22           ` [PATCH v2 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
                             ` (4 subsequent siblings)
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:20 UTC (permalink / raw)
  To: libc-alpha

Last commit made it so that the value passed for that parameter was
always 0 at its only call site.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/cache.c                | 16 +++-------------
 elf/ldconfig.c             |  3 +--
 sysdeps/generic/ldconfig.h |  2 +-
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/elf/cache.c b/elf/cache.c
index f5f3ef8c..ecbea2a0 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -764,7 +764,7 @@ save_cache (const char *cache_name)
 /* Add one library to the cache.  */
 void
 add_to_cache (const char *path, const char *filename, const char *soname,
-	      int flags, unsigned int isa_level, uint64_t hwcap,
+	      int flags, unsigned int isa_level,
 	      struct glibc_hwcaps_subdirectory *hwcaps)
 {
   struct cache_entry *new_entry = xmalloc (sizeof (*new_entry));
@@ -782,22 +782,12 @@ add_to_cache (const char *path, const char *filename, const char *soname,
   new_entry->path = path_interned;
   new_entry->flags = flags;
   new_entry->isa_level = isa_level;
-  new_entry->hwcap = hwcap;
+  new_entry->hwcap = 0;
   new_entry->hwcaps = hwcaps;
   new_entry->bits_hwcap = 0;
 
   if (hwcaps != NULL)
-    {
-      assert (hwcap == 0);
-      hwcaps->used = true;
-    }
-
-  /* Count the number of bits set in the masked value.  */
-  for (size_t i = 0;
-       (~((1ULL << i) - 1) & hwcap) != 0 && i < 8 * sizeof (hwcap); ++i)
-    if ((hwcap & (1ULL << i)) != 0)
-      ++new_entry->bits_hwcap;
-
+    hwcaps->used = true;
 
   /* Keep the list sorted - search for right place to insert.  */
   struct cache_entry *ptr = entries;
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 9399c228..56325c6c 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -982,8 +982,7 @@ search_dir (const struct dir_entry *entry)
 	}
       if (opt_build_cache)
 	add_to_cache (entry->path, filename, dlib_ptr->soname,
-		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
-		      entry->hwcaps);
+		      dlib_ptr->flag, dlib_ptr->isa_level, entry->hwcaps);
     }
 
   /* Free all resources.  */
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db..24222b0f 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -70,7 +70,7 @@ const char *glibc_hwcaps_subdirectory_name
 
 extern void add_to_cache (const char *path, const char *filename,
 			  const char *soname, int flags,
-			  unsigned int isa_level, uint64_t hwcap,
+			  unsigned int isa_level,
 			  struct glibc_hwcaps_subdirectory *);
 
 extern void init_aux_cache (void);
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
                             ` (2 preceding siblings ...)
  2022-09-17 14:20           ` [PATCH v2 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
@ 2022-09-17 14:22           ` Javier Pello
  2022-09-22 16:03             ` Florian Weimer
  2022-09-17 14:23           ` [PATCH v2 5/6] elf: Remove _dl_string_hwcap Javier Pello
                             ` (3 subsequent siblings)
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:22 UTC (permalink / raw)
  To: libc-alpha

They were set to 0 on initialisation and never changed later after
last commit.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/cache.c | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/elf/cache.c b/elf/cache.c
index ecbea2a0..10e61ae4 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -145,10 +145,8 @@ struct cache_entry
   struct stringtable_entry *path; /* Path to find library.  */
   int flags;			/* Flags to indicate kind of library.  */
   unsigned int isa_level;	/* Required ISA level.  */
-  uint64_t hwcap;		/* Important hardware capabilities.  */
-  int bits_hwcap;		/* Number of bits set in hwcap.  */
 
-  /* glibc-hwcaps subdirectory.  If not NULL, hwcap must be zero.  */
+  /* glibc-hwcaps subdirectory.  */
   struct glibc_hwcaps_subdirectory *hwcaps;
 
   struct cache_entry *next;	/* Next entry in list.  */
@@ -433,15 +431,6 @@ compare (const struct cache_entry *e1, const struct cache_entry *e2)
 	  if (res != 0)
 	    return res;
 	}
-      /* Sort by most specific hwcap.  */
-      if (e2->bits_hwcap > e1->bits_hwcap)
-	return 1;
-      else if (e2->bits_hwcap < e1->bits_hwcap)
-	return -1;
-      else if (e2->hwcap > e1->hwcap)
-	return 1;
-      else if (e2->hwcap < e1->hwcap)
-	return -1;
     }
   return res;
 }
@@ -547,14 +536,13 @@ save_cache (const char *cache_name)
   int cache_entry_count = 0;
   /* The old format doesn't contain hwcap entries and doesn't contain
      libraries in subdirectories with hwcaps entries.  Count therefore
-     also all entries with hwcap == 0.  */
+     all entries.  */
   int cache_entry_old_count = 0;
 
   for (entry = entries; entry != NULL; entry = entry->next)
     {
       ++cache_entry_count;
-      if (entry->hwcap == 0)
-	++cache_entry_old_count;
+      ++cache_entry_old_count;
     }
 
   struct stringtable_finalized strings_finalized;
@@ -626,7 +614,7 @@ save_cache (const char *cache_name)
   for (idx_old = 0, idx_new = 0, entry = entries; entry != NULL;
        entry = entry->next, ++idx_new)
     {
-      if (opt_format != opt_format_new && entry->hwcap == 0)
+      if (opt_format != opt_format_new)
 	{
 	  file_entries->libs[idx_old].flags = entry->flags;
 	  /* XXX: Actually we can optimize here and remove duplicates.  */
@@ -644,7 +632,7 @@ save_cache (const char *cache_name)
 	  file_entries_new->libs[idx_new].flags = entry->flags;
 	  file_entries_new->libs[idx_new].osversion_unused = 0;
 	  if (entry->hwcaps == NULL)
-	    file_entries_new->libs[idx_new].hwcap = entry->hwcap;
+	    file_entries_new->libs[idx_new].hwcap = 0;
 	  else
 	    file_entries_new->libs[idx_new].hwcap
 	      = compute_hwcap_value (entry);
@@ -654,9 +642,7 @@ save_cache (const char *cache_name)
 	    = str_offset + entry->path->offset;
 	}
 
-      /* Ignore entries with hwcap for old format.  */
-      if (entry->hwcap == 0)
-	++idx_old;
+      ++idx_old;
     }
 
   /* Duplicate last old cache entry if needed.  */
@@ -782,9 +768,7 @@ add_to_cache (const char *path, const char *filename, const char *soname,
   new_entry->path = path_interned;
   new_entry->flags = flags;
   new_entry->isa_level = isa_level;
-  new_entry->hwcap = 0;
   new_entry->hwcaps = hwcaps;
-  new_entry->bits_hwcap = 0;
 
   if (hwcaps != NULL)
     hwcaps->used = true;
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 5/6] elf: Remove _dl_string_hwcap
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
                             ` (3 preceding siblings ...)
  2022-09-17 14:22           ` [PATCH v2 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
@ 2022-09-17 14:23           ` Javier Pello
  2022-09-17 14:24           ` [PATCH v2 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
                             ` (2 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:23 UTC (permalink / raw)
  To: libc-alpha

Removal of legacy hwcaps support from the dynamic loader left
no users of _dl_string_hwcap.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 sysdeps/alpha/dl-procinfo.h                   |  2 --
 sysdeps/csky/dl-procinfo.h                    |  2 --
 sysdeps/generic/dl-procinfo.h                 |  2 --
 sysdeps/mips/dl-procinfo.h                    |  2 --
 sysdeps/powerpc/dl-procinfo.h                 | 10 ----------
 sysdeps/s390/dl-procinfo.h                    | 14 --------------
 sysdeps/sparc/dl-procinfo.h                   | 13 -------------
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h | 12 ------------
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     | 12 ------------
 sysdeps/x86/dl-hwcap.h                        | 14 --------------
 10 files changed, 83 deletions(-)

diff --git a/sysdeps/alpha/dl-procinfo.h b/sysdeps/alpha/dl-procinfo.h
index 31630fbb..6a12297d 100644
--- a/sysdeps/alpha/dl-procinfo.h
+++ b/sysdeps/alpha/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/csky/dl-procinfo.h b/sysdeps/csky/dl-procinfo.h
index d29e19a9..5da90087 100644
--- a/sysdeps/csky/dl-procinfo.h
+++ b/sysdeps/csky/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h
index 8f736e1d..033bcb3e 100644
--- a/sysdeps/generic/dl-procinfo.h
+++ b/sysdeps/generic/dl-procinfo.h
@@ -34,8 +34,6 @@
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT 0
 
-#define _dl_string_hwcap(str) (-1)
-
 #define _dl_string_platform(str) (-1)
 
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/mips/dl-procinfo.h b/sysdeps/mips/dl-procinfo.h
index 619dc089..25127c36 100644
--- a/sysdeps/mips/dl-procinfo.h
+++ b/sysdeps/mips/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 6ed15610..a0b2d779 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -69,16 +69,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_powerpc_cap_flags)[idx];
 }
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
-    if (strcmp (str, _dl_hwcap_string (i)) == 0)
-      return i;
-  return -1;
-}
-
 static inline int
 __attribute__ ((unused, always_inline))
 _dl_string_platform (const char *str)
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
index e1f88b9a..73aad1fd 100644
--- a/sysdeps/s390/dl-procinfo.h
+++ b/sysdeps/s390/dl-procinfo.h
@@ -83,20 +83,6 @@ _dl_hwcap_string (int idx)
   return _dl_s390_cap_flags[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-
-  for (i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_s390_cap_flags[i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 static inline int
 __attribute__ ((unused, always_inline))
 _dl_string_platform (const char *str)
diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
index 4a723b53..fa095832 100644
--- a/sysdeps/sparc/dl-procinfo.h
+++ b/sysdeps/sparc/dl-procinfo.h
@@ -52,19 +52,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_sparc_cap_flags)[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-  for (i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, GLRO(dl_sparc_cap_flags) [i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 #include <bits/wordsize.h>
 #define HWCAP_IMPORTANT_V9	(__WORDSIZE == 64 ? 0 : HWCAP_SPARC_V9)
 #define HWCAP_IMPORTANT		(HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index aa505223..f7382f63 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -37,18 +37,6 @@ _dl_hwcap_string (int idx)
   return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
 };
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_hwcap_string (i)) == 0)
-	return i;
-    }
-  return -1;
-};
-
 /* There're no platforms to filter out.  */
 #define _DL_HWCAP_PLATFORM 0
 
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
index 1f4c8c3a..d8c0f262 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
@@ -75,18 +75,6 @@ _dl_procinfo (unsigned int type, unsigned long int word)
 
 #define HWCAP_IMPORTANT		(HWCAP_ARM_VFP | HWCAP_ARM_NEON)
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_hwcap_string (i)) == 0)
-	return i;
-    }
-  return -1;
-};
-
 #define _dl_string_platform(str) (-1)
 
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/x86/dl-hwcap.h b/sysdeps/x86/dl-hwcap.h
index 26790afc..1313cecd 100644
--- a/sysdeps/x86/dl-hwcap.h
+++ b/sysdeps/x86/dl-hwcap.h
@@ -57,20 +57,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_x86_hwcap_flags)[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-
-  for (i = HWCAP_START; i < HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, GLRO(dl_x86_hwcap_flags)[i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 /* We cannot provide a general printing function.  */
 #define _dl_procinfo(type, word) -1
 
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 6/6] elf: Simplify output of hwcap subdirectories in ld.so help
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
                             ` (4 preceding siblings ...)
  2022-09-17 14:23           ` [PATCH v2 5/6] elf: Remove _dl_string_hwcap Javier Pello
@ 2022-09-17 14:24           ` Javier Pello
  2022-09-21 16:26           ` [PATCH v2 0/6] Remove legacy hwcaps support Joseph Myers
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-17 14:24 UTC (permalink / raw)
  To: libc-alpha

The print_hwcap_1 machinery was useful for the legacy hwcaps
subdirectories, but it is not worth the trouble now that they
are gone.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-usage.c | 43 +++++++------------------------------------
 1 file changed, 7 insertions(+), 36 deletions(-)

diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index efd6c77c..754a6391 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state)
   print_search_path_for_help_1 (__rtld_search_dirs.dirs);
 }
 
-/* Helper function for printing flags associated with a HWCAP name.  */
-static void
-print_hwcap_1 (bool *first, bool active, const char *label)
-{
-  if (active)
-    {
-      if (*first)
-        {
-          _dl_printf (" (");
-          *first = false;
-        }
-      else
-        _dl_printf (", ");
-      _dl_printf ("%s", label);
-    }
-}
-
-/* Called after a series of print_hwcap_1 calls to emit the line
-   terminator.  */
-static void
-print_hwcap_1_finish (bool *first)
-{
-  if (*first)
-    _dl_printf ("\n");
-  else
-    _dl_printf (")\n");
-}
-
 /* Print the header for print_hwcaps_subdirectories.  */
 static void
 print_hwcaps_subdirectories_header (bool *nothing_printed)
@@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
     {
       print_hwcaps_subdirectories_header (&nothing_printed);
       print_hwcaps_subdirectories_name (&split);
-      bool first = true;
-      print_hwcap_1 (&first, true, "searched");
-      print_hwcap_1_finish (&first);
+      _dl_printf (" (searched)\n");
     }
 
   /* The built-in glibc-hwcaps subdirectories.  Do the filtering
@@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
     {
       print_hwcaps_subdirectories_header (&nothing_printed);
       print_hwcaps_subdirectories_name (&split);
-      bool first = true;
-      print_hwcap_1 (&first, mask & 1, "supported");
       bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask,
                                          split.segment, split.length);
-      print_hwcap_1 (&first, !listed, "masked");
-      print_hwcap_1 (&first, (mask & 1) && listed, "searched");
-      print_hwcap_1_finish (&first);
+      if (mask & 1)
+        _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked");
+      else if (!listed)
+        _dl_printf (" (masked)\n");
+      else
+        _dl_printf ("\n");
       mask >>= 1;
     }
 
-- 
2.36.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 0/6] Remove legacy hwcaps support
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
                             ` (5 preceding siblings ...)
  2022-09-17 14:24           ` [PATCH v2 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
@ 2022-09-21 16:26           ` Joseph Myers
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
  7 siblings, 0 replies; 53+ messages in thread
From: Joseph Myers @ 2022-09-21 16:26 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

I still think this needs a NEWS entry for the removal, as I said for the 
previous version.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader
  2022-09-17 14:18           ` [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
@ 2022-09-22 11:46             ` Florian Weimer
  0 siblings, 0 replies; 53+ messages in thread
From: Florian Weimer @ 2022-09-22 11:46 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

> Remove support for the legacy hwcaps subdirectories from the dynamic
> loader.
>
> Signed-off-by: Javier Pello <devel@otheo.eu>

Reviewed-by: Florian Weimer <fweimer@redhat.com>

This patch is okay by itself, but you'll have to remove
sysdeps/x86_64/tst-x86_64-1.c in a precursor patch because it exercises
this functionality and fails after this removal.

I think elf/tstplatform-1 is still valid because it tests the $PLATFORM
dynamic string token.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 2/6] elf: Remove legacy hwcaps support from ldconfig
  2022-09-17 14:19           ` [PATCH v2 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
@ 2022-09-22 12:14             ` Florian Weimer
  0 siblings, 0 replies; 53+ messages in thread
From: Florian Weimer @ 2022-09-22 12:14 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

> Remove support for the legacy hwcaps subdirectories from ldconfig.
>
> Signed-off-by: Javier Pello <devel@otheo.eu>
> ---
>  elf/ldconfig.c | 149 +++----------------------------------------------
>  1 file changed, 8 insertions(+), 141 deletions(-)
>
> diff --git a/elf/ldconfig.c b/elf/ldconfig.c
> index 6f37f38f..9399c228 100644
> --- a/elf/ldconfig.c
> +++ b/elf/ldconfig.c
> @@ -46,16 +46,6 @@

> @@ -813,9 +719,7 @@ search_dir (const struct dir_entry *entry)
>  	 subdirectory)?  The dynamic linker is also considered as
>  	 shared library.  */
>        if (!_dl_is_dso (direntry->d_name)
> -	  && (direntry->d_type == DT_REG
> -	      || (entry->hwcaps == NULL
> -		  && !is_hwcap_platform (direntry->d_name))))
> +	  && (direntry->d_type == DT_REG || entry->hwcaps == NULL))
>  	continue;
>

The comment needs updating.

Rest looks okay.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 3/6] elf: Remove hwcap parameter from add_to_cache signature
  2022-09-17 14:20           ` [PATCH v2 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
@ 2022-09-22 16:02             ` Florian Weimer
  0 siblings, 0 replies; 53+ messages in thread
From: Florian Weimer @ 2022-09-22 16:02 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

> Last commit made it so that the value passed for that parameter was
> always 0 at its only call site.
>
> Signed-off-by: Javier Pello <devel@otheo.eu>

Patch looks okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  2022-09-17 14:22           ` [PATCH v2 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
@ 2022-09-22 16:03             ` Florian Weimer
  0 siblings, 0 replies; 53+ messages in thread
From: Florian Weimer @ 2022-09-22 16:03 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha

* Javier Pello:

> They were set to 0 on initialisation and never changed later after
> last commit.
>
> Signed-off-by: Javier Pello <devel@otheo.eu>

I think this should be okay, too.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 0/8] Remove legacy hwcaps support
  2022-09-17 14:17         ` [PATCH v2 " Javier Pello
                             ` (6 preceding siblings ...)
  2022-09-21 16:26           ` [PATCH v2 0/6] Remove legacy hwcaps support Joseph Myers
@ 2022-09-27 18:03           ` Javier Pello
  2022-09-27 18:05             ` [PATCH v3 1/8] x86_64: Remove platform directory library loading test Javier Pello
                               ` (7 more replies)
  7 siblings, 8 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:03 UTC (permalink / raw)
  To: libc-alpha

Here is a respin of the series, now with 8 patches.

Patch 1 removes the tst-x86_64-1 test, as requested, as this test
would fail after the following commits.

Patches 2-5 (formerly 1-4) implement the removal of legacy hwcaps
support itself; all of them are reviewed except for patch 3, which
missed updating a comment.

Patch 6 adds a NEWS entry for the removal of the legacy hwcaps
support.

Patches 7 and 8 are unreviewed, and I wonder if they are wanted.
I am myself unsure about patch 7, but the changes in patch 8 do
simplify the code somewhat.


Javier Pello (8):
  x86_64: Remove platform directory library loading test
  elf: Remove legacy hwcaps support from the dynamic loader
  elf: Remove legacy hwcaps support from ldconfig
  elf: Remove hwcap parameter from add_to_cache signature
  elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  Add NEWS entry for legacy hwcaps removal
  elf: Remove _dl_string_hwcap
  elf: Simplify output of hwcap subdirectories in ld.so help

 NEWS                                          |   5 +-
 elf/Makefile                                  |   6 -
 elf/cache.c                                   |  42 +---
 elf/dl-hwcaps.c                               | 184 +-----------------
 elf/dl-usage.c                                |  75 +------
 elf/ldconfig.c                                | 156 +--------------
 sysdeps/alpha/dl-procinfo.h                   |   2 -
 sysdeps/csky/dl-procinfo.h                    |   2 -
 sysdeps/generic/dl-procinfo.h                 |   2 -
 sysdeps/generic/ldconfig.h                    |   2 +-
 sysdeps/mips/dl-procinfo.h                    |   2 -
 sysdeps/powerpc/dl-procinfo.h                 |  10 -
 sysdeps/s390/dl-procinfo.h                    |  14 --
 sysdeps/sparc/dl-procinfo.h                   |  13 --
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h |  12 --
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     |  12 --
 sysdeps/x86/dl-hwcap.h                        |  14 --
 sysdeps/x86_64/Makefile                       |  16 --
 sysdeps/x86_64/tst-x86_64-1.c                 |  26 ---
 sysdeps/x86_64/tst-x86_64mod-1.c              |  22 ---
 20 files changed, 40 insertions(+), 577 deletions(-)
 delete mode 100644 sysdeps/x86_64/tst-x86_64-1.c
 delete mode 100644 sysdeps/x86_64/tst-x86_64mod-1.c

-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 1/8] x86_64: Remove platform directory library loading test
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
@ 2022-09-27 18:05             ` Javier Pello
  2022-10-03 14:56               ` Adhemerval Zanella Netto
  2022-09-27 18:05             ` [PATCH v3 2/8] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
                               ` (6 subsequent siblings)
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:05 UTC (permalink / raw)
  To: libc-alpha

This was to test loading of shared libraries from platform
subdirectories, but this functionality is going away in the
following commits.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 sysdeps/x86_64/Makefile          | 16 ----------------
 sysdeps/x86_64/tst-x86_64-1.c    | 26 --------------------------
 sysdeps/x86_64/tst-x86_64mod-1.c | 22 ----------------------
 3 files changed, 64 deletions(-)
 delete mode 100644 sysdeps/x86_64/tst-x86_64-1.c
 delete mode 100644 sysdeps/x86_64/tst-x86_64mod-1.c

diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index c19bef2d..3627c565 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -57,17 +57,6 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
 CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
 CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
 
-tests += tst-x86_64-1
-modules-names += x86_64/tst-x86_64mod-1
-extra-test-objs += tst-x86_64mod-1.o
-LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
-ifneq (no,$(have-tunables))
-# Test the state size for XSAVE when XSAVEC is disabled.
-tst-x86_64-1-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-XSAVEC
-endif
-
-$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
-
 ifneq (no,$(have-tunables))
 tests += tst-platform-1
 modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
@@ -208,11 +197,6 @@ tests += \
   tst-rsi-wcslen
 endif
 
-$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
-	$(make-target-directory)
-	rm -f $@
-	ln $< $@
-
 do-tests-clean common-mostlyclean: tst-x86_64-1-clean
 
 .PHONY: tst-x86_64-1-clean
diff --git a/sysdeps/x86_64/tst-x86_64-1.c b/sysdeps/x86_64/tst-x86_64-1.c
deleted file mode 100644
index 550439e5..00000000
--- a/sysdeps/x86_64/tst-x86_64-1.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Test searching the "x86_64" directory for shared libraries.
-   Copyright (C) 2017-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-extern void foo (void);
-
-int
-main (void)
-{
-  foo ();
-  return 0;
-}
diff --git a/sysdeps/x86_64/tst-x86_64mod-1.c b/sysdeps/x86_64/tst-x86_64mod-1.c
deleted file mode 100644
index a80458c4..00000000
--- a/sysdeps/x86_64/tst-x86_64mod-1.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Test searching the "x86_64" directory for shared libraries.
-   Copyright (C) 2017-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-void
-foo (void)
-{
-}
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 2/8] elf: Remove legacy hwcaps support from the dynamic loader
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
  2022-09-27 18:05             ` [PATCH v3 1/8] x86_64: Remove platform directory library loading test Javier Pello
@ 2022-09-27 18:05             ` Javier Pello
  2022-09-27 18:06             ` [PATCH v3 3/8] elf: Remove legacy hwcaps support from ldconfig Javier Pello
                               ` (5 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:05 UTC (permalink / raw)
  To: libc-alpha

Remove support for the legacy hwcaps subdirectories from the dynamic
loader.

Signed-off-by: Javier Pello <devel@otheo.eu>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
---
 elf/Makefile    |   6 --
 elf/dl-hwcaps.c | 184 +++---------------------------------------------
 elf/dl-usage.c  |  32 ---------
 3 files changed, 10 insertions(+), 212 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index 008770bf..276343a4 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -2689,12 +2689,6 @@ $(objpfx)tst-rtld-help.out: $(objpfx)ld.so
 	$(test-wrapper) $(rtld-prefix) --help > $@; \
 	status=$$?; \
 	echo "info: ld.so exit status: $$status" >> $@; \
-	if ! grep -q 'Legacy HWCAP subdirectories under library search path directories' $@; then \
-	  echo "error: missing subdirectory pattern" >> $@; \
-	  if test $$status -eq 0; then \
-	    status=1; \
-	  fi; \
-	fi; \
 	(exit $$status); \
 	$(evaluate-test)
 
diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 92eb5379..ae2423eb 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -170,17 +170,7 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
 		      const char *glibc_hwcaps_mask,
 		      size_t *sz, size_t *max_capstrlen)
 {
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  /* Determine how many important bits are set.  */
-  uint64_t masked = GLRO(dl_hwcap) & hwcap_mask;
-  size_t cnt = GLRO (dl_platform) != NULL;
-  size_t n, m;
-  struct r_strlenpair *result;
-  struct r_strlenpair *rp;
-  char *cp;
-
-  /* glibc-hwcaps subdirectories.  These are exempted from the power
-     set construction below.  */
+  /* glibc-hwcaps subdirectories.  */
   uint32_t hwcaps_subdirs_active = _dl_hwcaps_subdirs_active ();
   struct hwcaps_counts hwcaps_counts =  { 0, };
   update_hwcaps_counts (&hwcaps_counts, glibc_hwcaps_prepend, -1, NULL);
@@ -193,72 +183,14 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
   /* Each hwcaps subdirectory has a GLIBC_HWCAPS_PREFIX string prefix
      and a "/" suffix once stored in the result.  */
   hwcaps_counts.maximum_length += strlen (GLIBC_HWCAPS_PREFIX) + 1;
-  size_t hwcaps_sz = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
+  size_t total = (hwcaps_counts.count * (strlen (GLIBC_HWCAPS_PREFIX) + 1)
 		  + hwcaps_counts.total_length);
 
-  /* Count the number of bits set in the masked value.  */
-  for (n = 0; (~((1ULL << n) - 1) & masked) != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
-      ++cnt;
-
-  /* For TLS enabled builds always add 'tls'.  */
-  ++cnt;
-
-  /* Create temporary data structure to generate result table.  */
-  struct r_strlenpair temp[cnt];
-  m = 0;
-  for (n = 0; masked != 0; ++n)
-    if ((masked & (1ULL << n)) != 0)
-      {
-	temp[m].str = _dl_hwcap_string (n);
-	temp[m].len = strlen (temp[m].str);
-	masked ^= 1ULL << n;
-	++m;
-      }
-  if (GLRO (dl_platform) != NULL)
-    {
-      temp[m].str = GLRO (dl_platform);
-      temp[m].len = GLRO (dl_platformlen);
-      ++m;
-    }
-
-  temp[m].str = "tls";
-  temp[m].len = 3;
-  ++m;
-
-  assert (m == cnt);
-
-  /* Determine the total size of all strings together.  */
-  size_t total;
-  if (cnt == 1)
-    total = temp[0].len + 1;
-  else
-    {
-      total = temp[0].len + temp[cnt - 1].len + 2;
-      if (cnt > 2)
-	{
-	  total <<= 1;
-	  for (n = 1; n + 1 < cnt; ++n)
-	    total += temp[n].len + 1;
-	  if (cnt > 3
-	      && (cnt >= sizeof (size_t) * 8
-		  || total + (sizeof (*result) << 3)
-		     >= (1UL << (sizeof (size_t) * 8 - cnt + 3))))
-	    _dl_signal_error (ENOMEM, NULL, NULL,
-			      N_("cannot create capability list"));
-
-	  total <<= cnt - 3;
-	}
-    }
+  *sz = hwcaps_counts.count + 1;
 
-  *sz = hwcaps_counts.count + (1 << cnt);
-
-  /* This is the overall result, including both glibc-hwcaps
-     subdirectories and the legacy hwcaps subdirectories using the
-     power set construction.  */
-  total += hwcaps_sz;
+  /* This is the overall result.  */
   struct r_strlenpair *overall_result
-    = malloc (*sz * sizeof (*result) + total);
+    = malloc (*sz * sizeof (*overall_result) + total);
   if (overall_result == NULL)
     _dl_signal_error (ENOMEM, NULL, NULL,
 		      N_("cannot create capability list"));
@@ -271,110 +203,14 @@ _dl_important_hwcaps (const char *glibc_hwcaps_prepend,
     copy_hwcaps (&target, glibc_hwcaps_prepend, -1, NULL);
     copy_hwcaps (&target, _dl_hwcaps_subdirs,
 		 hwcaps_subdirs_active, glibc_hwcaps_mask);
-    /* Set up the write target for the power set construction.  */
-    result = target.next_pair;
-    cp = target.next_string;
-  }
 
-
-  /* Power set construction begins here.  We use a very compressed way
-     to store the various combinations of capability names.  */
-
-  if (cnt == 1)
-    {
-      result[0].str = cp;
-      result[0].len = temp[0].len + 1;
-      result[1].str = cp;
-      result[1].len = 0;
-      cp = __mempcpy (cp, temp[0].str, temp[0].len);
-      *cp = '/';
-      if (result[0].len > hwcaps_counts.maximum_length)
-	*max_capstrlen = result[0].len;
-      else
-	*max_capstrlen = hwcaps_counts.maximum_length;
-
-      return overall_result;
-    }
-
-  /* Fill in the information.  This follows the following scheme
-     (indices from TEMP for four strings):
-	entry #0: 0, 1, 2, 3	binary: 1111
-	      #1: 0, 1, 3		1101
-	      #2: 0, 2, 3		1011
-	      #3: 0, 3			1001
-     This allows the representation of all possible combinations of
-     capability names in the string.  First generate the strings.  */
-  result[1].str = result[0].str = cp;
-#define add(idx) \
-      cp = __mempcpy (__mempcpy (cp, temp[idx].str, temp[idx].len), "/", 1);
-  if (cnt == 2)
-    {
-      add (1);
-      add (0);
-    }
-  else
-    {
-      n = 1 << (cnt - 1);
-      do
-	{
-	  n -= 2;
-
-	  /* We always add the last string.  */
-	  add (cnt - 1);
-
-	  /* Add the strings which have the bit set in N.  */
-	  for (m = cnt - 2; m > 0; --m)
-	    if ((n & (1 << m)) != 0)
-	      add (m);
-
-	  /* Always add the first string.  */
-	  add (0);
-	}
-      while (n != 0);
-    }
-#undef add
-
-  /* Now we are ready to install the string pointers and length.  */
-  for (n = 0; n < (1UL << cnt); ++n)
-    result[n].len = 0;
-  n = cnt;
-  do
-    {
-      size_t mask = 1 << --n;
-
-      rp = result;
-      for (m = 1 << cnt; m > 0; ++rp)
-	if ((--m & mask) != 0)
-	  rp->len += temp[n].len + 1;
-    }
-  while (n != 0);
-
-  /* The first half of the strings all include the first string.  */
-  n = (1 << cnt) - 2;
-  rp = &result[2];
-  while (n != (1UL << (cnt - 1)))
-    {
-      if ((--n & 1) != 0)
-	rp[0].str = rp[-2].str + rp[-2].len;
-      else
-	rp[0].str = rp[-1].str;
-      ++rp;
-    }
-
-  /* The second half starts right after the first part of the string of
-     the corresponding entry in the first half.  */
-  do
-    {
-      rp[0].str = rp[-(1 << (cnt - 1))].str + temp[cnt - 1].len + 1;
-      ++rp;
-    }
-  while (--n != 0);
+    /* Append an empty entry for the base directory itself.  */
+    target.next_pair->str = target.next_string;
+    target.next_pair->len = 0;
+  }
 
   /* The maximum string length.  */
-  if (result[0].len > hwcaps_counts.maximum_length)
-    *max_capstrlen = result[0].len;
-  else
-    *max_capstrlen = hwcaps_counts.maximum_length;
+  *max_capstrlen = hwcaps_counts.maximum_length;
 
   return overall_result;
 }
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index 98d8c989..efd6c77c 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -193,37 +193,6 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
 No subdirectories of glibc-hwcaps directories are searched.\n");
 }
 
-/* Write a list of hwcap subdirectories to standard output.  See
- _dl_important_hwcaps in dl-hwcaps.c.  */
-static void
-print_legacy_hwcap_directories (void)
-{
-  _dl_printf ("\n\
-Legacy HWCAP subdirectories under library search path directories:\n");
-
-  const char *platform = GLRO (dl_platform);
-  if (platform != NULL)
-    _dl_printf ("  %s (AT_PLATFORM; supported, searched)\n", platform);
-
-  _dl_printf ("  tls (supported, searched)\n");
-
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  uint64_t searched = GLRO (dl_hwcap) & hwcap_mask;
-  for (int n = 63; n >= 0; --n)
-    {
-      uint64_t bit = 1ULL << n;
-      if (HWCAP_IMPORTANT & bit)
-        {
-          _dl_printf ("  %s", _dl_hwcap_string (n));
-          bool first = true;
-          print_hwcap_1 (&first, GLRO (dl_hwcap) & bit, "supported");
-          print_hwcap_1 (&first, !(hwcap_mask & bit), "masked");
-          print_hwcap_1 (&first, searched & bit, "searched");
-          print_hwcap_1_finish (&first);
-        }
-    }
-}
-
 void
 _dl_help (const char *argv0, struct dl_main_state *state)
 {
@@ -270,6 +239,5 @@ This program interpreter self-identifies as: " RTLD "\n\
               argv0);
   print_search_path_for_help (state);
   print_hwcaps_subdirectories (state);
-  print_legacy_hwcap_directories ();
   _exit (EXIT_SUCCESS);
 }
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 3/8] elf: Remove legacy hwcaps support from ldconfig
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
  2022-09-27 18:05             ` [PATCH v3 1/8] x86_64: Remove platform directory library loading test Javier Pello
  2022-09-27 18:05             ` [PATCH v3 2/8] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
@ 2022-09-27 18:06             ` Javier Pello
  2022-10-03 15:31               ` Adhemerval Zanella Netto
  2022-09-27 18:07             ` [PATCH v3 4/8] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
                               ` (4 subsequent siblings)
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:06 UTC (permalink / raw)
  To: libc-alpha

Remove support for the legacy hwcaps subdirectories from ldconfig.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/ldconfig.c | 155 ++++---------------------------------------------
 1 file changed, 10 insertions(+), 145 deletions(-)

diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 6f37f38f..0d19d847 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -46,16 +46,6 @@
 
 #include <dl-procinfo.h>
 
-/* This subpath in search path entries is always supported and
-   included in the cache for backwards compatibility.  */
-#define TLS_SUBPATH "tls"
-
-/* The MSB of the hwcap field is set for objects in TLS_SUBPATH
-   directories.  There is always TLS support in glibc, so the dynamic
-   loader does not check the bit directly.  But more hwcap bits make a
-   an object more preferred, so the bit still has meaning.  */
-#define TLS_HWCAP_BIT 63
-
 #ifndef LD_SO_CONF
 # define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
 #endif
@@ -120,9 +110,6 @@ static char *cache_file;
 /* Configuration file.  */
 static const char *config_file;
 
-/* Mask to use for important hardware capabilities.  */
-static unsigned long int hwcap_mask = HWCAP_IMPORTANT;
-
 /* Name and version of program.  */
 static void print_version (FILE *stream, struct argp_state *state);
 void (*argp_program_version_hook) (FILE *, struct argp_state *)
@@ -163,75 +150,6 @@ static struct argp argp =
   options, parse_opt, NULL, doc, NULL, more_help, NULL
 };
 
-/* Check if string corresponds to an important hardware capability or
-   a platform.  */
-static int
-is_hwcap_platform (const char *name)
-{
-  int hwcap_idx = _dl_string_hwcap (name);
-
-  /* Is this a normal hwcap for the machine like "fpu?"  */
-  if (hwcap_idx != -1 && ((1 << hwcap_idx) & hwcap_mask))
-    return 1;
-
-  /* Is this a platform pseudo-hwcap like "i686?"  */
-  hwcap_idx = _dl_string_platform (name);
-  if (hwcap_idx != -1)
-    return 1;
-
-  /* Backwards-compatibility for the "tls" subdirectory.  */
-  if (strcmp (name, TLS_SUBPATH) == 0)
-    return 1;
-
-  return 0;
-}
-
-/* Get hwcap (including platform) encoding of path.  */
-static uint64_t
-path_hwcap (const char *path)
-{
-  char *str = xstrdup (path);
-  char *ptr;
-  uint64_t hwcap = 0;
-  uint64_t h;
-
-  size_t len;
-
-  len = strlen (str);
-  if (str[len] == '/')
-    str[len] = '\0';
-
-  /* Search pathname from the end and check for hwcap strings.  */
-  for (;;)
-    {
-      ptr = strrchr (str, '/');
-
-      if (ptr == NULL)
-	break;
-
-      h = _dl_string_hwcap (ptr + 1);
-
-      if (h == (uint64_t) -1)
-	{
-	  h = _dl_string_platform (ptr + 1);
-	  if (h == (uint64_t) -1)
-	    {
-	      if (strcmp (ptr + 1, TLS_SUBPATH) == 0)
-		h = TLS_HWCAP_BIT;
-	      else
-		break;
-	    }
-	}
-      hwcap += 1ULL << h;
-
-      /* Search the next part of the path.  */
-      *ptr = '\0';
-    }
-
-  free (str);
-  return hwcap;
-}
-
 /* Handle program arguments.  */
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
@@ -747,27 +665,15 @@ struct dlib_entry
 static void
 search_dir (const struct dir_entry *entry)
 {
-  uint64_t hwcap;
-  if (entry->hwcaps == NULL)
-    {
-      hwcap = path_hwcap (entry->path);
-      if (opt_verbose)
-	{
-	  if (hwcap != 0)
-	    printf ("%s: (hwcap: %#.16" PRIx64 ")", entry->path, hwcap);
-	  else
-	    printf ("%s:", entry->path);
-	}
-    }
-  else
+  if (opt_verbose)
     {
-      hwcap = 0;
-      if (opt_verbose)
+      if (entry->hwcaps == NULL)
+	printf ("%s:", entry->path);
+      else
 	printf ("%s: (hwcap: \"%s\")", entry->path,
 		glibc_hwcaps_subdirectory_name (entry->hwcaps));
+      printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
     }
-  if (opt_verbose)
-    printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
 
   char *dir_name;
   char *real_file_name;
@@ -808,14 +714,10 @@ search_dir (const struct dir_entry *entry)
 	  && direntry->d_type != DT_REG
 	  && direntry->d_type != DT_DIR)
 	continue;
-      /* Does this file look like a shared library or is it a hwcap
-	 subdirectory (if not already processing a glibc-hwcaps
-	 subdirectory)?  The dynamic linker is also considered as
-	 shared library.  */
+      /* Does this file look like a shared library?  The dynamic linker
+	 is also considered as shared library.  */
       if (!_dl_is_dso (direntry->d_name)
-	  && (direntry->d_type == DT_REG
-	      || (entry->hwcaps == NULL
-		  && !is_hwcap_platform (direntry->d_name))))
+	  && (direntry->d_type == DT_REG || entry->hwcaps == NULL))
 	continue;
 
       size_t len = strlen (direntry->d_name);
@@ -863,7 +765,6 @@ search_dir (const struct dir_entry *entry)
 	  }
 
       struct stat stat_buf;
-      bool is_dir;
       int is_link = S_ISLNK (lstat_buf.st_mode);
       if (is_link)
 	{
@@ -898,37 +799,13 @@ search_dir (const struct dir_entry *entry)
 	  if (opt_chroot != NULL)
 	    free (target_name);
 
-	  is_dir = S_ISDIR (stat_buf.st_mode);
-
 	  /* lstat_buf is later stored, update contents.  */
 	  lstat_buf.st_dev = stat_buf.st_dev;
 	  lstat_buf.st_ino = stat_buf.st_ino;
 	  lstat_buf.st_size = stat_buf.st_size;
 	  lstat_buf.st_ctime = stat_buf.st_ctime;
 	}
-      else
-	is_dir = S_ISDIR (lstat_buf.st_mode);
-
-      /* No descending into subdirectories if this directory is a
-	 glibc-hwcaps subdirectory (which are not recursive).  */
-      if (entry->hwcaps == NULL
-	  && is_dir && is_hwcap_platform (direntry->d_name))
-	{
-	  if (!is_link
-	      && direntry->d_type != DT_UNKNOWN
-	      && __builtin_expect (lstat (real_file_name, &lstat_buf), 0))
-	    {
-	      error (0, errno, _("Cannot lstat %s"), file_name);
-	      continue;
-	    }
-
-	  /* Handle subdirectory later.  */
-	  struct dir_entry *new_entry = new_sub_entry (entry, file_name,
-						       &lstat_buf);
-	  add_single_dir (new_entry, 0);
-	  continue;
-	}
-      else if (!S_ISREG (lstat_buf.st_mode) && !is_link)
+      else if (!S_ISREG (lstat_buf.st_mode))
 	continue;
 
       char *real_name;
@@ -1103,7 +980,7 @@ search_dir (const struct dir_entry *entry)
 	}
       if (opt_build_cache)
 	add_to_cache (entry->path, filename, dlib_ptr->soname,
-		      dlib_ptr->flag, dlib_ptr->isa_level, hwcap,
+		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
 		      entry->hwcaps);
     }
 
@@ -1290,16 +1167,6 @@ parse_conf_include (const char *config_file, unsigned int lineno,
   free (copy);
 }
 
-/* Honour LD_HWCAP_MASK.  */
-static void
-set_hwcap (void)
-{
-  char *mask = getenv ("LD_HWCAP_MASK");
-
-  if (mask)
-    hwcap_mask = strtoul (mask, NULL, 0);
-}
-
 
 int
 main (int argc, char **argv)
@@ -1332,8 +1199,6 @@ main (int argc, char **argv)
 	  add_dir_1 (argv[i], "<cmdline>", 0);
     }
 
-  set_hwcap ();
-
   if (opt_chroot != NULL)
     {
       /* Normalize the path a bit, we might need it for printing later.  */
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 4/8] elf: Remove hwcap parameter from add_to_cache signature
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
                               ` (2 preceding siblings ...)
  2022-09-27 18:06             ` [PATCH v3 3/8] elf: Remove legacy hwcaps support from ldconfig Javier Pello
@ 2022-09-27 18:07             ` Javier Pello
  2022-09-27 18:08             ` [PATCH v3 5/8] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
                               ` (3 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:07 UTC (permalink / raw)
  To: libc-alpha

Last commit made it so that the value passed for that parameter was
always 0 at its only call site.

Signed-off-by: Javier Pello <devel@otheo.eu>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
---
 elf/cache.c                | 16 +++-------------
 elf/ldconfig.c             |  3 +--
 sysdeps/generic/ldconfig.h |  2 +-
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/elf/cache.c b/elf/cache.c
index f5f3ef8c..ecbea2a0 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -764,7 +764,7 @@ save_cache (const char *cache_name)
 /* Add one library to the cache.  */
 void
 add_to_cache (const char *path, const char *filename, const char *soname,
-	      int flags, unsigned int isa_level, uint64_t hwcap,
+	      int flags, unsigned int isa_level,
 	      struct glibc_hwcaps_subdirectory *hwcaps)
 {
   struct cache_entry *new_entry = xmalloc (sizeof (*new_entry));
@@ -782,22 +782,12 @@ add_to_cache (const char *path, const char *filename, const char *soname,
   new_entry->path = path_interned;
   new_entry->flags = flags;
   new_entry->isa_level = isa_level;
-  new_entry->hwcap = hwcap;
+  new_entry->hwcap = 0;
   new_entry->hwcaps = hwcaps;
   new_entry->bits_hwcap = 0;
 
   if (hwcaps != NULL)
-    {
-      assert (hwcap == 0);
-      hwcaps->used = true;
-    }
-
-  /* Count the number of bits set in the masked value.  */
-  for (size_t i = 0;
-       (~((1ULL << i) - 1) & hwcap) != 0 && i < 8 * sizeof (hwcap); ++i)
-    if ((hwcap & (1ULL << i)) != 0)
-      ++new_entry->bits_hwcap;
-
+    hwcaps->used = true;
 
   /* Keep the list sorted - search for right place to insert.  */
   struct cache_entry *ptr = entries;
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 0d19d847..e6c24e71 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -980,8 +980,7 @@ search_dir (const struct dir_entry *entry)
 	}
       if (opt_build_cache)
 	add_to_cache (entry->path, filename, dlib_ptr->soname,
-		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
-		      entry->hwcaps);
+		      dlib_ptr->flag, dlib_ptr->isa_level, entry->hwcaps);
     }
 
   /* Free all resources.  */
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db..24222b0f 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -70,7 +70,7 @@ const char *glibc_hwcaps_subdirectory_name
 
 extern void add_to_cache (const char *path, const char *filename,
 			  const char *soname, int flags,
-			  unsigned int isa_level, uint64_t hwcap,
+			  unsigned int isa_level,
 			  struct glibc_hwcaps_subdirectory *);
 
 extern void init_aux_cache (void);
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 5/8] elf: Remove hwcap and bits_hwcap fields from struct cache_entry
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
                               ` (3 preceding siblings ...)
  2022-09-27 18:07             ` [PATCH v3 4/8] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
@ 2022-09-27 18:08             ` Javier Pello
  2022-09-27 18:08             ` [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal Javier Pello
                               ` (2 subsequent siblings)
  7 siblings, 0 replies; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:08 UTC (permalink / raw)
  To: libc-alpha

They were set to 0 on initialisation and never changed later after
last commit.

Signed-off-by: Javier Pello <devel@otheo.eu>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
---
 elf/cache.c | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/elf/cache.c b/elf/cache.c
index ecbea2a0..10e61ae4 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -145,10 +145,8 @@ struct cache_entry
   struct stringtable_entry *path; /* Path to find library.  */
   int flags;			/* Flags to indicate kind of library.  */
   unsigned int isa_level;	/* Required ISA level.  */
-  uint64_t hwcap;		/* Important hardware capabilities.  */
-  int bits_hwcap;		/* Number of bits set in hwcap.  */
 
-  /* glibc-hwcaps subdirectory.  If not NULL, hwcap must be zero.  */
+  /* glibc-hwcaps subdirectory.  */
   struct glibc_hwcaps_subdirectory *hwcaps;
 
   struct cache_entry *next;	/* Next entry in list.  */
@@ -433,15 +431,6 @@ compare (const struct cache_entry *e1, const struct cache_entry *e2)
 	  if (res != 0)
 	    return res;
 	}
-      /* Sort by most specific hwcap.  */
-      if (e2->bits_hwcap > e1->bits_hwcap)
-	return 1;
-      else if (e2->bits_hwcap < e1->bits_hwcap)
-	return -1;
-      else if (e2->hwcap > e1->hwcap)
-	return 1;
-      else if (e2->hwcap < e1->hwcap)
-	return -1;
     }
   return res;
 }
@@ -547,14 +536,13 @@ save_cache (const char *cache_name)
   int cache_entry_count = 0;
   /* The old format doesn't contain hwcap entries and doesn't contain
      libraries in subdirectories with hwcaps entries.  Count therefore
-     also all entries with hwcap == 0.  */
+     all entries.  */
   int cache_entry_old_count = 0;
 
   for (entry = entries; entry != NULL; entry = entry->next)
     {
       ++cache_entry_count;
-      if (entry->hwcap == 0)
-	++cache_entry_old_count;
+      ++cache_entry_old_count;
     }
 
   struct stringtable_finalized strings_finalized;
@@ -626,7 +614,7 @@ save_cache (const char *cache_name)
   for (idx_old = 0, idx_new = 0, entry = entries; entry != NULL;
        entry = entry->next, ++idx_new)
     {
-      if (opt_format != opt_format_new && entry->hwcap == 0)
+      if (opt_format != opt_format_new)
 	{
 	  file_entries->libs[idx_old].flags = entry->flags;
 	  /* XXX: Actually we can optimize here and remove duplicates.  */
@@ -644,7 +632,7 @@ save_cache (const char *cache_name)
 	  file_entries_new->libs[idx_new].flags = entry->flags;
 	  file_entries_new->libs[idx_new].osversion_unused = 0;
 	  if (entry->hwcaps == NULL)
-	    file_entries_new->libs[idx_new].hwcap = entry->hwcap;
+	    file_entries_new->libs[idx_new].hwcap = 0;
 	  else
 	    file_entries_new->libs[idx_new].hwcap
 	      = compute_hwcap_value (entry);
@@ -654,9 +642,7 @@ save_cache (const char *cache_name)
 	    = str_offset + entry->path->offset;
 	}
 
-      /* Ignore entries with hwcap for old format.  */
-      if (entry->hwcap == 0)
-	++idx_old;
+      ++idx_old;
     }
 
   /* Duplicate last old cache entry if needed.  */
@@ -782,9 +768,7 @@ add_to_cache (const char *path, const char *filename, const char *soname,
   new_entry->path = path_interned;
   new_entry->flags = flags;
   new_entry->isa_level = isa_level;
-  new_entry->hwcap = 0;
   new_entry->hwcaps = hwcaps;
-  new_entry->bits_hwcap = 0;
 
   if (hwcaps != NULL)
     hwcaps->used = true;
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
                               ` (4 preceding siblings ...)
  2022-09-27 18:08             ` [PATCH v3 5/8] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
@ 2022-09-27 18:08             ` Javier Pello
  2022-10-03 15:44               ` Adhemerval Zanella Netto
  2022-09-27 18:09             ` [PATCH v3 7/8] elf: Remove _dl_string_hwcap Javier Pello
  2022-09-27 18:10             ` [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:08 UTC (permalink / raw)
  To: libc-alpha

Add a NEWS entry noting the removal of the legacy hwcaps search
mechanism for shared objects.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 NEWS | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index ef274d1a..dbb48914 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,10 @@ Major new features:
 
 Deprecated and removed features, and other changes affecting compatibility:
 
-  [Add deprecations, removals and changes affecting compatibility here]
+* glibc no longer loads shared objects from the "tls" subdirectories on the
+  library search path or the subdirectory that corresponds to the AT_PLATFORM
+  system name, or employs the legacy AT_HWCAP search mechanism, which was
+  deprecated in version 2.33.
 
 Changes to build and runtime requirements:
 
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 7/8] elf: Remove _dl_string_hwcap
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
                               ` (5 preceding siblings ...)
  2022-09-27 18:08             ` [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal Javier Pello
@ 2022-09-27 18:09             ` Javier Pello
  2022-10-03 16:52               ` Adhemerval Zanella Netto
  2022-09-27 18:10             ` [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:09 UTC (permalink / raw)
  To: libc-alpha

Removal of legacy hwcaps support from the dynamic loader left
no users of _dl_string_hwcap.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 sysdeps/alpha/dl-procinfo.h                   |  2 --
 sysdeps/csky/dl-procinfo.h                    |  2 --
 sysdeps/generic/dl-procinfo.h                 |  2 --
 sysdeps/mips/dl-procinfo.h                    |  2 --
 sysdeps/powerpc/dl-procinfo.h                 | 10 ----------
 sysdeps/s390/dl-procinfo.h                    | 14 --------------
 sysdeps/sparc/dl-procinfo.h                   | 13 -------------
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h | 12 ------------
 sysdeps/unix/sysv/linux/arm/dl-procinfo.h     | 12 ------------
 sysdeps/x86/dl-hwcap.h                        | 14 --------------
 10 files changed, 83 deletions(-)

diff --git a/sysdeps/alpha/dl-procinfo.h b/sysdeps/alpha/dl-procinfo.h
index 31630fbb..6a12297d 100644
--- a/sysdeps/alpha/dl-procinfo.h
+++ b/sysdeps/alpha/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/csky/dl-procinfo.h b/sysdeps/csky/dl-procinfo.h
index d29e19a9..5da90087 100644
--- a/sysdeps/csky/dl-procinfo.h
+++ b/sysdeps/csky/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h
index 8f736e1d..033bcb3e 100644
--- a/sysdeps/generic/dl-procinfo.h
+++ b/sysdeps/generic/dl-procinfo.h
@@ -34,8 +34,6 @@
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT 0
 
-#define _dl_string_hwcap(str) (-1)
-
 #define _dl_string_platform(str) (-1)
 
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/mips/dl-procinfo.h b/sysdeps/mips/dl-procinfo.h
index 619dc089..25127c36 100644
--- a/sysdeps/mips/dl-procinfo.h
+++ b/sysdeps/mips/dl-procinfo.h
@@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
 /* We don't have any hardware capabilities.  */
 #define _DL_HWCAP_COUNT	0
 
-#define _dl_string_hwcap(str) (-1)
-
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 6ed15610..a0b2d779 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -69,16 +69,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_powerpc_cap_flags)[idx];
 }
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
-    if (strcmp (str, _dl_hwcap_string (i)) == 0)
-      return i;
-  return -1;
-}
-
 static inline int
 __attribute__ ((unused, always_inline))
 _dl_string_platform (const char *str)
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
index e1f88b9a..73aad1fd 100644
--- a/sysdeps/s390/dl-procinfo.h
+++ b/sysdeps/s390/dl-procinfo.h
@@ -83,20 +83,6 @@ _dl_hwcap_string (int idx)
   return _dl_s390_cap_flags[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-
-  for (i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_s390_cap_flags[i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 static inline int
 __attribute__ ((unused, always_inline))
 _dl_string_platform (const char *str)
diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
index 4a723b53..fa095832 100644
--- a/sysdeps/sparc/dl-procinfo.h
+++ b/sysdeps/sparc/dl-procinfo.h
@@ -52,19 +52,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_sparc_cap_flags)[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-  for (i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, GLRO(dl_sparc_cap_flags) [i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 #include <bits/wordsize.h>
 #define HWCAP_IMPORTANT_V9	(__WORDSIZE == 64 ? 0 : HWCAP_SPARC_V9)
 #define HWCAP_IMPORTANT		(HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index aa505223..f7382f63 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -37,18 +37,6 @@ _dl_hwcap_string (int idx)
   return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
 };
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_hwcap_string (i)) == 0)
-	return i;
-    }
-  return -1;
-};
-
 /* There're no platforms to filter out.  */
 #define _DL_HWCAP_PLATFORM 0
 
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
index 1f4c8c3a..d8c0f262 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
@@ -75,18 +75,6 @@ _dl_procinfo (unsigned int type, unsigned long int word)
 
 #define HWCAP_IMPORTANT		(HWCAP_ARM_VFP | HWCAP_ARM_NEON)
 
-static inline int
-__attribute__ ((unused))
-_dl_string_hwcap (const char *str)
-{
-  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, _dl_hwcap_string (i)) == 0)
-	return i;
-    }
-  return -1;
-};
-
 #define _dl_string_platform(str) (-1)
 
 #endif /* dl-procinfo.h */
diff --git a/sysdeps/x86/dl-hwcap.h b/sysdeps/x86/dl-hwcap.h
index 26790afc..1313cecd 100644
--- a/sysdeps/x86/dl-hwcap.h
+++ b/sysdeps/x86/dl-hwcap.h
@@ -57,20 +57,6 @@ _dl_hwcap_string (int idx)
   return GLRO(dl_x86_hwcap_flags)[idx];
 };
 
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
-  int i;
-
-  for (i = HWCAP_START; i < HWCAP_COUNT; i++)
-    {
-      if (strcmp (str, GLRO(dl_x86_hwcap_flags)[i]) == 0)
-	return i;
-    }
-  return -1;
-};
-
 /* We cannot provide a general printing function.  */
 #define _dl_procinfo(type, word) -1
 
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help
  2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
                               ` (6 preceding siblings ...)
  2022-09-27 18:09             ` [PATCH v3 7/8] elf: Remove _dl_string_hwcap Javier Pello
@ 2022-09-27 18:10             ` Javier Pello
  2022-10-03 17:02               ` Adhemerval Zanella Netto
  7 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-09-27 18:10 UTC (permalink / raw)
  To: libc-alpha

The print_hwcap_1 machinery was useful for the legacy hwcaps
subdirectories, but it is not worth the trouble now that they
are gone.

Signed-off-by: Javier Pello <devel@otheo.eu>
---
 elf/dl-usage.c | 43 +++++++------------------------------------
 1 file changed, 7 insertions(+), 36 deletions(-)

diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index efd6c77c..754a6391 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state)
   print_search_path_for_help_1 (__rtld_search_dirs.dirs);
 }
 
-/* Helper function for printing flags associated with a HWCAP name.  */
-static void
-print_hwcap_1 (bool *first, bool active, const char *label)
-{
-  if (active)
-    {
-      if (*first)
-        {
-          _dl_printf (" (");
-          *first = false;
-        }
-      else
-        _dl_printf (", ");
-      _dl_printf ("%s", label);
-    }
-}
-
-/* Called after a series of print_hwcap_1 calls to emit the line
-   terminator.  */
-static void
-print_hwcap_1_finish (bool *first)
-{
-  if (*first)
-    _dl_printf ("\n");
-  else
-    _dl_printf (")\n");
-}
-
 /* Print the header for print_hwcaps_subdirectories.  */
 static void
 print_hwcaps_subdirectories_header (bool *nothing_printed)
@@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
     {
       print_hwcaps_subdirectories_header (&nothing_printed);
       print_hwcaps_subdirectories_name (&split);
-      bool first = true;
-      print_hwcap_1 (&first, true, "searched");
-      print_hwcap_1_finish (&first);
+      _dl_printf (" (searched)\n");
     }
 
   /* The built-in glibc-hwcaps subdirectories.  Do the filtering
@@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
     {
       print_hwcaps_subdirectories_header (&nothing_printed);
       print_hwcaps_subdirectories_name (&split);
-      bool first = true;
-      print_hwcap_1 (&first, mask & 1, "supported");
       bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask,
                                          split.segment, split.length);
-      print_hwcap_1 (&first, !listed, "masked");
-      print_hwcap_1 (&first, (mask & 1) && listed, "searched");
-      print_hwcap_1_finish (&first);
+      if (mask & 1)
+        _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked");
+      else if (!listed)
+        _dl_printf (" (masked)\n");
+      else
+        _dl_printf ("\n");
       mask >>= 1;
     }
 
-- 
2.37.3

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 1/8] x86_64: Remove platform directory library loading test
  2022-09-27 18:05             ` [PATCH v3 1/8] x86_64: Remove platform directory library loading test Javier Pello
@ 2022-10-03 14:56               ` Adhemerval Zanella Netto
  2022-10-04 17:53                 ` Javier Pello
  0 siblings, 1 reply; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-03 14:56 UTC (permalink / raw)
  To: Javier Pello, libc-alpha



On 27/09/22 15:05, Javier Pello wrote:
> This was to test loading of shared libraries from platform
> subdirectories, but this functionality is going away in the
> following commits.
> 
> Signed-off-by: Javier Pello <devel@otheo.eu>

LGTM, although I think this patch should be move after the functionality
is removed.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/x86_64/Makefile          | 16 ----------------
>  sysdeps/x86_64/tst-x86_64-1.c    | 26 --------------------------
>  sysdeps/x86_64/tst-x86_64mod-1.c | 22 ----------------------
>  3 files changed, 64 deletions(-)
>  delete mode 100644 sysdeps/x86_64/tst-x86_64-1.c
>  delete mode 100644 sysdeps/x86_64/tst-x86_64mod-1.c
> 
> diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
> index c19bef2d..3627c565 100644
> --- a/sysdeps/x86_64/Makefile
> +++ b/sysdeps/x86_64/Makefile
> @@ -57,17 +57,6 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
>  CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
>  CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
>  
> -tests += tst-x86_64-1
> -modules-names += x86_64/tst-x86_64mod-1
> -extra-test-objs += tst-x86_64mod-1.o
> -LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
> -ifneq (no,$(have-tunables))
> -# Test the state size for XSAVE when XSAVEC is disabled.
> -tst-x86_64-1-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-XSAVEC
> -endif
> -
> -$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
> -
>  ifneq (no,$(have-tunables))
>  tests += tst-platform-1
>  modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
> @@ -208,11 +197,6 @@ tests += \
>    tst-rsi-wcslen
>  endif
>  
> -$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
> -	$(make-target-directory)
> -	rm -f $@
> -	ln $< $@
> -
>  do-tests-clean common-mostlyclean: tst-x86_64-1-clean
>  
>  .PHONY: tst-x86_64-1-clean
> diff --git a/sysdeps/x86_64/tst-x86_64-1.c b/sysdeps/x86_64/tst-x86_64-1.c
> deleted file mode 100644
> index 550439e5..00000000
> --- a/sysdeps/x86_64/tst-x86_64-1.c
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -/* Test searching the "x86_64" directory for shared libraries.
> -   Copyright (C) 2017-2022 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <https://www.gnu.org/licenses/>.  */
> -
> -extern void foo (void);
> -
> -int
> -main (void)
> -{
> -  foo ();
> -  return 0;
> -}
> diff --git a/sysdeps/x86_64/tst-x86_64mod-1.c b/sysdeps/x86_64/tst-x86_64mod-1.c
> deleted file mode 100644
> index a80458c4..00000000
> --- a/sysdeps/x86_64/tst-x86_64mod-1.c
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -/* Test searching the "x86_64" directory for shared libraries.
> -   Copyright (C) 2017-2022 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <https://www.gnu.org/licenses/>.  */
> -
> -void
> -foo (void)
> -{
> -}

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 3/8] elf: Remove legacy hwcaps support from ldconfig
  2022-09-27 18:06             ` [PATCH v3 3/8] elf: Remove legacy hwcaps support from ldconfig Javier Pello
@ 2022-10-03 15:31               ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-03 15:31 UTC (permalink / raw)
  To: Javier Pello, libc-alpha



On 27/09/22 15:06, Javier Pello wrote:
> Remove support for the legacy hwcaps subdirectories from ldconfig.
> 
> Signed-off-by: Javier Pello <devel@otheo.eu>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  elf/ldconfig.c | 155 ++++---------------------------------------------
>  1 file changed, 10 insertions(+), 145 deletions(-)
> 
> diff --git a/elf/ldconfig.c b/elf/ldconfig.c
> index 6f37f38f..0d19d847 100644
> --- a/elf/ldconfig.c
> +++ b/elf/ldconfig.c
> @@ -46,16 +46,6 @@
>  
>  #include <dl-procinfo.h>
>  
> -/* This subpath in search path entries is always supported and
> -   included in the cache for backwards compatibility.  */
> -#define TLS_SUBPATH "tls"
> -
> -/* The MSB of the hwcap field is set for objects in TLS_SUBPATH
> -   directories.  There is always TLS support in glibc, so the dynamic
> -   loader does not check the bit directly.  But more hwcap bits make a
> -   an object more preferred, so the bit still has meaning.  */
> -#define TLS_HWCAP_BIT 63
> -
>  #ifndef LD_SO_CONF
>  # define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
>  #endif
> @@ -120,9 +110,6 @@ static char *cache_file;
>  /* Configuration file.  */
>  static const char *config_file;
>  
> -/* Mask to use for important hardware capabilities.  */
> -static unsigned long int hwcap_mask = HWCAP_IMPORTANT;
> -
>  /* Name and version of program.  */
>  static void print_version (FILE *stream, struct argp_state *state);
>  void (*argp_program_version_hook) (FILE *, struct argp_state *)
> @@ -163,75 +150,6 @@ static struct argp argp =
>    options, parse_opt, NULL, doc, NULL, more_help, NULL
>  };
>  
> -/* Check if string corresponds to an important hardware capability or
> -   a platform.  */
> -static int
> -is_hwcap_platform (const char *name)
> -{
> -  int hwcap_idx = _dl_string_hwcap (name);
> -
> -  /* Is this a normal hwcap for the machine like "fpu?"  */
> -  if (hwcap_idx != -1 && ((1 << hwcap_idx) & hwcap_mask))
> -    return 1;
> -
> -  /* Is this a platform pseudo-hwcap like "i686?"  */
> -  hwcap_idx = _dl_string_platform (name);
> -  if (hwcap_idx != -1)
> -    return 1;
> -
> -  /* Backwards-compatibility for the "tls" subdirectory.  */
> -  if (strcmp (name, TLS_SUBPATH) == 0)
> -    return 1;
> -
> -  return 0;
> -}
> -
> -/* Get hwcap (including platform) encoding of path.  */
> -static uint64_t
> -path_hwcap (const char *path)
> -{
> -  char *str = xstrdup (path);
> -  char *ptr;
> -  uint64_t hwcap = 0;
> -  uint64_t h;
> -
> -  size_t len;
> -
> -  len = strlen (str);
> -  if (str[len] == '/')
> -    str[len] = '\0';
> -
> -  /* Search pathname from the end and check for hwcap strings.  */
> -  for (;;)
> -    {
> -      ptr = strrchr (str, '/');
> -
> -      if (ptr == NULL)
> -	break;
> -
> -      h = _dl_string_hwcap (ptr + 1);
> -
> -      if (h == (uint64_t) -1)
> -	{
> -	  h = _dl_string_platform (ptr + 1);
> -	  if (h == (uint64_t) -1)
> -	    {
> -	      if (strcmp (ptr + 1, TLS_SUBPATH) == 0)
> -		h = TLS_HWCAP_BIT;
> -	      else
> -		break;
> -	    }
> -	}
> -      hwcap += 1ULL << h;
> -
> -      /* Search the next part of the path.  */
> -      *ptr = '\0';
> -    }
> -
> -  free (str);
> -  return hwcap;
> -}
> -
>  /* Handle program arguments.  */
>  static error_t
>  parse_opt (int key, char *arg, struct argp_state *state)
> @@ -747,27 +665,15 @@ struct dlib_entry
>  static void
>  search_dir (const struct dir_entry *entry)
>  {
> -  uint64_t hwcap;
> -  if (entry->hwcaps == NULL)
> -    {
> -      hwcap = path_hwcap (entry->path);
> -      if (opt_verbose)
> -	{
> -	  if (hwcap != 0)
> -	    printf ("%s: (hwcap: %#.16" PRIx64 ")", entry->path, hwcap);
> -	  else
> -	    printf ("%s:", entry->path);
> -	}
> -    }
> -  else
> +  if (opt_verbose)
>      {
> -      hwcap = 0;
> -      if (opt_verbose)
> +      if (entry->hwcaps == NULL)
> +	printf ("%s:", entry->path);
> +      else
>  	printf ("%s: (hwcap: \"%s\")", entry->path,
>  		glibc_hwcaps_subdirectory_name (entry->hwcaps));
> +      printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
>      }
> -  if (opt_verbose)
> -    printf (_(" (from %s:%d)\n"), entry->from_file, entry->from_line);
>  
>    char *dir_name;
>    char *real_file_name;
> @@ -808,14 +714,10 @@ search_dir (const struct dir_entry *entry)
>  	  && direntry->d_type != DT_REG
>  	  && direntry->d_type != DT_DIR)
>  	continue;
> -      /* Does this file look like a shared library or is it a hwcap
> -	 subdirectory (if not already processing a glibc-hwcaps
> -	 subdirectory)?  The dynamic linker is also considered as
> -	 shared library.  */
> +      /* Does this file look like a shared library?  The dynamic linker
> +	 is also considered as shared library.  */
>        if (!_dl_is_dso (direntry->d_name)
> -	  && (direntry->d_type == DT_REG
> -	      || (entry->hwcaps == NULL
> -		  && !is_hwcap_platform (direntry->d_name))))
> +	  && (direntry->d_type == DT_REG || entry->hwcaps == NULL))
>  	continue;
>  
>        size_t len = strlen (direntry->d_name);
> @@ -863,7 +765,6 @@ search_dir (const struct dir_entry *entry)
>  	  }
>  
>        struct stat stat_buf;
> -      bool is_dir;
>        int is_link = S_ISLNK (lstat_buf.st_mode);
>        if (is_link)
>  	{
> @@ -898,37 +799,13 @@ search_dir (const struct dir_entry *entry)
>  	  if (opt_chroot != NULL)
>  	    free (target_name);
>  
> -	  is_dir = S_ISDIR (stat_buf.st_mode);
> -
>  	  /* lstat_buf is later stored, update contents.  */
>  	  lstat_buf.st_dev = stat_buf.st_dev;
>  	  lstat_buf.st_ino = stat_buf.st_ino;
>  	  lstat_buf.st_size = stat_buf.st_size;
>  	  lstat_buf.st_ctime = stat_buf.st_ctime;
>  	}
> -      else
> -	is_dir = S_ISDIR (lstat_buf.st_mode);
> -
> -      /* No descending into subdirectories if this directory is a
> -	 glibc-hwcaps subdirectory (which are not recursive).  */
> -      if (entry->hwcaps == NULL
> -	  && is_dir && is_hwcap_platform (direntry->d_name))
> -	{
> -	  if (!is_link
> -	      && direntry->d_type != DT_UNKNOWN
> -	      && __builtin_expect (lstat (real_file_name, &lstat_buf), 0))
> -	    {
> -	      error (0, errno, _("Cannot lstat %s"), file_name);
> -	      continue;
> -	    }
> -
> -	  /* Handle subdirectory later.  */
> -	  struct dir_entry *new_entry = new_sub_entry (entry, file_name,
> -						       &lstat_buf);
> -	  add_single_dir (new_entry, 0);
> -	  continue;
> -	}
> -      else if (!S_ISREG (lstat_buf.st_mode) && !is_link)
> +      else if (!S_ISREG (lstat_buf.st_mode))
>  	continue;
>  
>        char *real_name;
> @@ -1103,7 +980,7 @@ search_dir (const struct dir_entry *entry)
>  	}
>        if (opt_build_cache)
>  	add_to_cache (entry->path, filename, dlib_ptr->soname,
> -		      dlib_ptr->flag, dlib_ptr->isa_level, hwcap,
> +		      dlib_ptr->flag, dlib_ptr->isa_level, 0,
>  		      entry->hwcaps);
>      }
>  
> @@ -1290,16 +1167,6 @@ parse_conf_include (const char *config_file, unsigned int lineno,
>    free (copy);
>  }
>  
> -/* Honour LD_HWCAP_MASK.  */
> -static void
> -set_hwcap (void)
> -{
> -  char *mask = getenv ("LD_HWCAP_MASK");
> -
> -  if (mask)
> -    hwcap_mask = strtoul (mask, NULL, 0);
> -}
> -
>  
>  int
>  main (int argc, char **argv)
> @@ -1332,8 +1199,6 @@ main (int argc, char **argv)
>  	  add_dir_1 (argv[i], "<cmdline>", 0);
>      }
>  
> -  set_hwcap ();
> -
>    if (opt_chroot != NULL)
>      {
>        /* Normalize the path a bit, we might need it for printing later.  */

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-09-27 18:08             ` [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal Javier Pello
@ 2022-10-03 15:44               ` Adhemerval Zanella Netto
  2022-10-03 19:29                 ` Andreas Schwab
  0 siblings, 1 reply; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-03 15:44 UTC (permalink / raw)
  To: Javier Pello, libc-alpha



On 27/09/22 15:08, Javier Pello wrote:
> Add a NEWS entry noting the removal of the legacy hwcaps search
> mechanism for shared objects.
> 
> Signed-off-by: Javier Pello <devel@otheo.eu>
> ---
>  NEWS | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/NEWS b/NEWS
> index ef274d1a..dbb48914 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -13,7 +13,10 @@ Major new features:
>  
>  Deprecated and removed features, and other changes affecting compatibility:
>  
> -  [Add deprecations, removals and changes affecting compatibility here]
> +* glibc no longer loads shared objects from the "tls" subdirectories on the
> +  library search path or the subdirectory that corresponds to the AT_PLATFORM
> +  system name, or employs the legacy AT_HWCAP search mechanism, which was
> +  deprecated in version 2.33.

I think NEWS entry usually reference to glibc with an article ('The glibc').
The rest sounds ok, although I am not a native english speaker.

>  
>  Changes to build and runtime requirements:
>  

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 7/8] elf: Remove _dl_string_hwcap
  2022-09-27 18:09             ` [PATCH v3 7/8] elf: Remove _dl_string_hwcap Javier Pello
@ 2022-10-03 16:52               ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-03 16:52 UTC (permalink / raw)
  To: Javier Pello, libc-alpha



On 27/09/22 15:09, Javier Pello wrote:
> Removal of legacy hwcaps support from the dynamic loader left
> no users of _dl_string_hwcap.
> 
> Signed-off-by: Javier Pello <devel@otheo.eu>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/alpha/dl-procinfo.h                   |  2 --
>  sysdeps/csky/dl-procinfo.h                    |  2 --
>  sysdeps/generic/dl-procinfo.h                 |  2 --
>  sysdeps/mips/dl-procinfo.h                    |  2 --
>  sysdeps/powerpc/dl-procinfo.h                 | 10 ----------
>  sysdeps/s390/dl-procinfo.h                    | 14 --------------
>  sysdeps/sparc/dl-procinfo.h                   | 13 -------------
>  sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h | 12 ------------
>  sysdeps/unix/sysv/linux/arm/dl-procinfo.h     | 12 ------------
>  sysdeps/x86/dl-hwcap.h                        | 14 --------------
>  10 files changed, 83 deletions(-)
> 
> diff --git a/sysdeps/alpha/dl-procinfo.h b/sysdeps/alpha/dl-procinfo.h
> index 31630fbb..6a12297d 100644
> --- a/sysdeps/alpha/dl-procinfo.h
> +++ b/sysdeps/alpha/dl-procinfo.h
> @@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
>  /* We don't have any hardware capabilities.  */
>  #define _DL_HWCAP_COUNT	0
>  
> -#define _dl_string_hwcap(str) (-1)
> -
>  #endif /* dl-procinfo.h */
> diff --git a/sysdeps/csky/dl-procinfo.h b/sysdeps/csky/dl-procinfo.h
> index d29e19a9..5da90087 100644
> --- a/sysdeps/csky/dl-procinfo.h
> +++ b/sysdeps/csky/dl-procinfo.h
> @@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
>  /* We don't have any hardware capabilities.  */
>  #define _DL_HWCAP_COUNT	0
>  
> -#define _dl_string_hwcap(str) (-1)
> -
>  #endif /* dl-procinfo.h */
> diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h
> index 8f736e1d..033bcb3e 100644
> --- a/sysdeps/generic/dl-procinfo.h
> +++ b/sysdeps/generic/dl-procinfo.h
> @@ -34,8 +34,6 @@
>  /* We don't have any hardware capabilities.  */
>  #define _DL_HWCAP_COUNT 0
>  
> -#define _dl_string_hwcap(str) (-1)
> -
>  #define _dl_string_platform(str) (-1)
>  
>  #endif /* dl-procinfo.h */
> diff --git a/sysdeps/mips/dl-procinfo.h b/sysdeps/mips/dl-procinfo.h
> index 619dc089..25127c36 100644
> --- a/sysdeps/mips/dl-procinfo.h
> +++ b/sysdeps/mips/dl-procinfo.h
> @@ -54,6 +54,4 @@ _dl_string_platform (const char *str)
>  /* We don't have any hardware capabilities.  */
>  #define _DL_HWCAP_COUNT	0
>  
> -#define _dl_string_hwcap(str) (-1)
> -
>  #endif /* dl-procinfo.h */
> diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
> index 6ed15610..a0b2d779 100644
> --- a/sysdeps/powerpc/dl-procinfo.h
> +++ b/sysdeps/powerpc/dl-procinfo.h
> @@ -69,16 +69,6 @@ _dl_hwcap_string (int idx)
>    return GLRO(dl_powerpc_cap_flags)[idx];
>  }
>  
> -static inline int
> -__attribute__ ((unused))
> -_dl_string_hwcap (const char *str)
> -{
> -  for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
> -    if (strcmp (str, _dl_hwcap_string (i)) == 0)
> -      return i;
> -  return -1;
> -}
> -
>  static inline int
>  __attribute__ ((unused, always_inline))
>  _dl_string_platform (const char *str)
> diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
> index e1f88b9a..73aad1fd 100644
> --- a/sysdeps/s390/dl-procinfo.h
> +++ b/sysdeps/s390/dl-procinfo.h
> @@ -83,20 +83,6 @@ _dl_hwcap_string (int idx)
>    return _dl_s390_cap_flags[idx];
>  };
>  
> -static inline int
> -__attribute__ ((unused, always_inline))
> -_dl_string_hwcap (const char *str)
> -{
> -  int i;
> -
> -  for (i = 0; i < _DL_HWCAP_COUNT; i++)
> -    {
> -      if (strcmp (str, _dl_s390_cap_flags[i]) == 0)
> -	return i;
> -    }
> -  return -1;
> -};
> -
>  static inline int
>  __attribute__ ((unused, always_inline))
>  _dl_string_platform (const char *str)
> diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
> index 4a723b53..fa095832 100644
> --- a/sysdeps/sparc/dl-procinfo.h
> +++ b/sysdeps/sparc/dl-procinfo.h
> @@ -52,19 +52,6 @@ _dl_hwcap_string (int idx)
>    return GLRO(dl_sparc_cap_flags)[idx];
>  };
>  
> -static inline int
> -__attribute__ ((unused, always_inline))
> -_dl_string_hwcap (const char *str)
> -{
> -  int i;
> -  for (i = 0; i < _DL_HWCAP_COUNT; i++)
> -    {
> -      if (strcmp (str, GLRO(dl_sparc_cap_flags) [i]) == 0)
> -	return i;
> -    }
> -  return -1;
> -};
> -
>  #include <bits/wordsize.h>
>  #define HWCAP_IMPORTANT_V9	(__WORDSIZE == 64 ? 0 : HWCAP_SPARC_V9)
>  #define HWCAP_IMPORTANT		(HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \
> diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
> index aa505223..f7382f63 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
> +++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
> @@ -37,18 +37,6 @@ _dl_hwcap_string (int idx)
>    return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
>  };
>  
> -static inline int
> -__attribute__ ((unused))
> -_dl_string_hwcap (const char *str)
> -{
> -  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
> -    {
> -      if (strcmp (str, _dl_hwcap_string (i)) == 0)
> -	return i;
> -    }
> -  return -1;
> -};
> -
>  /* There're no platforms to filter out.  */
>  #define _DL_HWCAP_PLATFORM 0
>  
> diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
> index 1f4c8c3a..d8c0f262 100644
> --- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
> +++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
> @@ -75,18 +75,6 @@ _dl_procinfo (unsigned int type, unsigned long int word)
>  
>  #define HWCAP_IMPORTANT		(HWCAP_ARM_VFP | HWCAP_ARM_NEON)
>  
> -static inline int
> -__attribute__ ((unused))
> -_dl_string_hwcap (const char *str)
> -{
> -  for (int i = 0; i < _DL_HWCAP_COUNT; i++)
> -    {
> -      if (strcmp (str, _dl_hwcap_string (i)) == 0)
> -	return i;
> -    }
> -  return -1;
> -};
> -
>  #define _dl_string_platform(str) (-1)
>  
>  #endif /* dl-procinfo.h */
> diff --git a/sysdeps/x86/dl-hwcap.h b/sysdeps/x86/dl-hwcap.h
> index 26790afc..1313cecd 100644
> --- a/sysdeps/x86/dl-hwcap.h
> +++ b/sysdeps/x86/dl-hwcap.h
> @@ -57,20 +57,6 @@ _dl_hwcap_string (int idx)
>    return GLRO(dl_x86_hwcap_flags)[idx];
>  };
>  
> -static inline int
> -__attribute__ ((unused, always_inline))
> -_dl_string_hwcap (const char *str)
> -{
> -  int i;
> -
> -  for (i = HWCAP_START; i < HWCAP_COUNT; i++)
> -    {
> -      if (strcmp (str, GLRO(dl_x86_hwcap_flags)[i]) == 0)
> -	return i;
> -    }
> -  return -1;
> -};
> -
>  /* We cannot provide a general printing function.  */
>  #define _dl_procinfo(type, word) -1
>  

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help
  2022-09-27 18:10             ` [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
@ 2022-10-03 17:02               ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-03 17:02 UTC (permalink / raw)
  To: Javier Pello, libc-alpha



On 27/09/22 15:10, Javier Pello wrote:
> The print_hwcap_1 machinery was useful for the legacy hwcaps
> subdirectories, but it is not worth the trouble now that they
> are gone.
> 
> Signed-off-by: Javier Pello <devel@otheo.eu>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  elf/dl-usage.c | 43 +++++++------------------------------------
>  1 file changed, 7 insertions(+), 36 deletions(-)
> 
> diff --git a/elf/dl-usage.c b/elf/dl-usage.c
> index efd6c77c..754a6391 100644
> --- a/elf/dl-usage.c
> +++ b/elf/dl-usage.c
> @@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state)
>    print_search_path_for_help_1 (__rtld_search_dirs.dirs);
>  }
>  
> -/* Helper function for printing flags associated with a HWCAP name.  */
> -static void
> -print_hwcap_1 (bool *first, bool active, const char *label)
> -{
> -  if (active)
> -    {
> -      if (*first)
> -        {
> -          _dl_printf (" (");
> -          *first = false;
> -        }
> -      else
> -        _dl_printf (", ");
> -      _dl_printf ("%s", label);
> -    }
> -}
> -
> -/* Called after a series of print_hwcap_1 calls to emit the line
> -   terminator.  */
> -static void
> -print_hwcap_1_finish (bool *first)
> -{
> -  if (*first)
> -    _dl_printf ("\n");
> -  else
> -    _dl_printf (")\n");
> -}
> -
>  /* Print the header for print_hwcaps_subdirectories.  */
>  static void
>  print_hwcaps_subdirectories_header (bool *nothing_printed)
> @@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
>      {
>        print_hwcaps_subdirectories_header (&nothing_printed);
>        print_hwcaps_subdirectories_name (&split);
> -      bool first = true;
> -      print_hwcap_1 (&first, true, "searched");
> -      print_hwcap_1_finish (&first);
> +      _dl_printf (" (searched)\n");
>      }
>  
>    /* The built-in glibc-hwcaps subdirectories.  Do the filtering
> @@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state)
>      {
>        print_hwcaps_subdirectories_header (&nothing_printed);
>        print_hwcaps_subdirectories_name (&split);
> -      bool first = true;
> -      print_hwcap_1 (&first, mask & 1, "supported");
>        bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask,
>                                           split.segment, split.length);
> -      print_hwcap_1 (&first, !listed, "masked");
> -      print_hwcap_1 (&first, (mask & 1) && listed, "searched");
> -      print_hwcap_1_finish (&first);
> +      if (mask & 1)
> +        _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked");
> +      else if (!listed)
> +        _dl_printf (" (masked)\n");
> +      else
> +        _dl_printf ("\n");
>        mask >>= 1;
>      }
>  

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-10-03 15:44               ` Adhemerval Zanella Netto
@ 2022-10-03 19:29                 ` Andreas Schwab
  2022-10-03 19:49                   ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 53+ messages in thread
From: Andreas Schwab @ 2022-10-03 19:29 UTC (permalink / raw)
  To: Adhemerval Zanella Netto via Libc-alpha
  Cc: Javier Pello, Adhemerval Zanella Netto

On Okt 03 2022, Adhemerval Zanella Netto via Libc-alpha wrote:

> I think NEWS entry usually reference to glibc with an article ('The glibc').

glibc is a proper name, and proper names don't come with articles.  You
can write "the GNU C library", but not "the glibc".

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-10-03 19:29                 ` Andreas Schwab
@ 2022-10-03 19:49                   ` Adhemerval Zanella Netto
  2022-10-03 19:59                     ` Florian Weimer
  0 siblings, 1 reply; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-03 19:49 UTC (permalink / raw)
  To: Andreas Schwab, Adhemerval Zanella Netto via Libc-alpha; +Cc: Javier Pello



On 03/10/22 16:29, Andreas Schwab wrote:
> On Okt 03 2022, Adhemerval Zanella Netto via Libc-alpha wrote:
> 
>> I think NEWS entry usually reference to glibc with an article ('The glibc').
> 
> glibc is a proper name, and proper names don't come with articles.  You
> can write "the GNU C library", but not "the glibc".
> 

Which would be the best option for the NEWS entry, just 'glibc' or a
more specific 'The GNU C library'?  I don't have a strong opinion here.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-10-03 19:49                   ` Adhemerval Zanella Netto
@ 2022-10-03 19:59                     ` Florian Weimer
  2022-10-04 18:00                       ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 53+ messages in thread
From: Florian Weimer @ 2022-10-03 19:59 UTC (permalink / raw)
  To: Adhemerval Zanella Netto via Libc-alpha
  Cc: Andreas Schwab, Adhemerval Zanella Netto, Javier Pello

* Adhemerval Zanella Netto via Libc-alpha:

> On 03/10/22 16:29, Andreas Schwab wrote:
>> On Okt 03 2022, Adhemerval Zanella Netto via Libc-alpha wrote:
>> 
>>> I think NEWS entry usually reference to glibc with an article ('The glibc').
>> 
>> glibc is a proper name, and proper names don't come with articles.  You
>> can write "the GNU C library", but not "the glibc".
>> 
>
> Which would be the best option for the NEWS entry, just 'glibc' or a
> more specific 'The GNU C library'?  I don't have a strong opinion here.

“The GNU C library” at the start of a sentence, otherwise glibc is
also okay.  In this case, you could use “The dynamic linker” or “The
glibc dynamic linker”.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 1/8] x86_64: Remove platform directory library loading test
  2022-10-03 14:56               ` Adhemerval Zanella Netto
@ 2022-10-04 17:53                 ` Javier Pello
  2022-10-04 17:59                   ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-10-04 17:53 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: libc-alpha

On Mon, 3 Oct 2022 11:56:47 -0300 Adhemerval Zanella Netto wrote:

> On 27/09/22 15:05, Javier Pello wrote:
> > This was to test loading of shared libraries from platform
> > subdirectories, but this functionality is going away in the
> > following commits.
> > 
> > Signed-off-by: Javier Pello <devel@otheo.eu>
> 
> LGTM, although I think this patch should be move after the
> functionality is removed.
> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Thanks. I put this patch first because that is what Florian
suggested, and I think that it makes sense to strive for the
testsuite to pass at any intermediate commits (otherwise bisecting
an unrelated bug may be harder), so the test should be removed
before the functionality, but I am fine either way.

Regards,
Javier

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 1/8] x86_64: Remove platform directory library loading test
  2022-10-04 17:53                 ` Javier Pello
@ 2022-10-04 17:59                   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-04 17:59 UTC (permalink / raw)
  To: Javier Pello; +Cc: libc-alpha



On 04/10/22 14:53, Javier Pello wrote:
> On Mon, 3 Oct 2022 11:56:47 -0300 Adhemerval Zanella Netto wrote:
> 
>> On 27/09/22 15:05, Javier Pello wrote:
>>> This was to test loading of shared libraries from platform
>>> subdirectories, but this functionality is going away in the
>>> following commits.
>>>
>>> Signed-off-by: Javier Pello <devel@otheo.eu>
>>
>> LGTM, although I think this patch should be move after the
>> functionality is removed.
>>
>> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
> Thanks. I put this patch first because that is what Florian
> suggested, and I think that it makes sense to strive for the
> testsuite to pass at any intermediate commits (otherwise bisecting
> an unrelated bug may be harder), so the test should be removed
> before the functionality, but I am fine either way.

Right, this make sense and I fine with current scheme then.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-10-03 19:59                     ` Florian Weimer
@ 2022-10-04 18:00                       ` Adhemerval Zanella Netto
  2022-10-05 18:12                         ` Javier Pello
  0 siblings, 1 reply; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-04 18:00 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella Netto via Libc-alpha
  Cc: Andreas Schwab, Javier Pello



On 03/10/22 16:59, Florian Weimer wrote:
> * Adhemerval Zanella Netto via Libc-alpha:
> 
>> On 03/10/22 16:29, Andreas Schwab wrote:
>>> On Okt 03 2022, Adhemerval Zanella Netto via Libc-alpha wrote:
>>>
>>>> I think NEWS entry usually reference to glibc with an article ('The glibc').
>>>
>>> glibc is a proper name, and proper names don't come with articles.  You
>>> can write "the GNU C library", but not "the glibc".
>>>
>>
>> Which would be the best option for the NEWS entry, just 'glibc' or a
>> more specific 'The GNU C library'?  I don't have a strong opinion here.
> 
> “The GNU C library” at the start of a sentence, otherwise glibc is
> also okay.  In this case, you could use “The dynamic linker” or “The
> glibc dynamic linker”.

Javier, are you ok with:

  The dynamic linker no longer loads shared objects from the "tls" 
  subdirectories on the library search path or the subdirectory 
  that corresponds to the AT_PLATFORM system name, or employs the 
  legacy AT_HWCAP search mechanism, which was deprecated in version 
  2.33.

If so I can wrap-up the patches and push upstream for you.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-10-04 18:00                       ` Adhemerval Zanella Netto
@ 2022-10-05 18:12                         ` Javier Pello
  2022-10-06 11:03                           ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 53+ messages in thread
From: Javier Pello @ 2022-10-05 18:12 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: Florian Weimer, Libc-alpha, Andreas Schwab

On Tue, 4 Oct 2022 15:00:33 -0300 Adhemerval Zanella Netto wrote:

> On 03/10/22 16:59, Florian Weimer wrote:
> > * Adhemerval Zanella Netto via Libc-alpha:
> > 
> >> On 03/10/22 16:29, Andreas Schwab wrote:
> >>> On Okt 03 2022, Adhemerval Zanella Netto via Libc-alpha wrote:
> >>>
> >>>> I think NEWS entry usually reference to glibc with an article ('The glibc').
> >>>
> >>> glibc is a proper name, and proper names don't come with articles.  You
> >>> can write "the GNU C library", but not "the glibc".
> >>>
> >>
> >> Which would be the best option for the NEWS entry, just 'glibc' or a
> >> more specific 'The GNU C library'?  I don't have a strong opinion here.
> > 
> > “The GNU C library” at the start of a sentence, otherwise glibc is
> > also okay.  In this case, you could use “The dynamic linker” or “The
> > glibc dynamic linker”.
> 
> Javier, are you ok with:
> 
>   The dynamic linker no longer loads shared objects from the "tls" 
>   subdirectories on the library search path or the subdirectory 
>   that corresponds to the AT_PLATFORM system name, or employs the 
>   legacy AT_HWCAP search mechanism, which was deprecated in version 
>   2.33.

Sure, I am fine with whatever you think is best.

> If so I can wrap-up the patches and push upstream for you.

Thank you.

Regards,
Javier

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal
  2022-10-05 18:12                         ` Javier Pello
@ 2022-10-06 11:03                           ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 53+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-06 11:03 UTC (permalink / raw)
  To: Javier Pello; +Cc: Florian Weimer, Libc-alpha, Andreas Schwab



On 05/10/22 15:12, Javier Pello wrote:
> On Tue, 4 Oct 2022 15:00:33 -0300 Adhemerval Zanella Netto wrote:
> 
>> On 03/10/22 16:59, Florian Weimer wrote:
>>> * Adhemerval Zanella Netto via Libc-alpha:
>>>
>>>> On 03/10/22 16:29, Andreas Schwab wrote:
>>>>> On Okt 03 2022, Adhemerval Zanella Netto via Libc-alpha wrote:
>>>>>
>>>>>> I think NEWS entry usually reference to glibc with an article ('The glibc').
>>>>>
>>>>> glibc is a proper name, and proper names don't come with articles.  You
>>>>> can write "the GNU C library", but not "the glibc".
>>>>>
>>>>
>>>> Which would be the best option for the NEWS entry, just 'glibc' or a
>>>> more specific 'The GNU C library'?  I don't have a strong opinion here.
>>>
>>> “The GNU C library” at the start of a sentence, otherwise glibc is
>>> also okay.  In this case, you could use “The dynamic linker” or “The
>>> glibc dynamic linker”.
>>
>> Javier, are you ok with:
>>
>>   The dynamic linker no longer loads shared objects from the "tls" 
>>   subdirectories on the library search path or the subdirectory 
>>   that corresponds to the AT_PLATFORM system name, or employs the 
>>   legacy AT_HWCAP search mechanism, which was deprecated in version 
>>   2.33.
> 
> Sure, I am fine with whatever you think is best.
> 
>> If so I can wrap-up the patches and push upstream for you.
> 
> Thank you.

Done.

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2022-10-06 11:03 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 18:06 [PATCH 0/4] elf: Fix hwcaps string size overestimation Javier Pello
2022-09-05 18:09 ` [PATCH 1/4] " Javier Pello
2022-09-08 10:15   ` Florian Weimer
2022-09-05 18:10 ` [PATCH 2/4] elf: Simplify hwcaps masked value bit counting Javier Pello
2022-09-05 18:12 ` [PATCH 3/4] elf: Remove unneeded conditional in _dl_important_hwcaps Javier Pello
2022-09-05 18:13 ` [PATCH 4/4] elf: Simplify hwcaps power set string construction Javier Pello
2022-09-06  7:35 ` [PATCH 0/4] elf: Fix hwcaps string size overestimation Florian Weimer
2022-09-06 18:12   ` Javier Pello
2022-09-08 11:23     ` Florian Weimer
2022-09-14 18:07       ` [PATCH 0/6] Remove legacy hwcaps support Javier Pello
2022-09-14 18:08         ` [PATCH 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
2022-09-14 18:10         ` [PATCH 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
2022-09-14 18:10         ` [PATCH 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
2022-09-14 18:12         ` [PATCH 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
2022-09-14 18:13         ` [PATCH 5/6] elf: Remove _dl_string_hwcap Javier Pello
2022-09-14 18:15         ` [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
2022-09-15  8:42           ` Carlos O'Donell
2022-09-15 19:12             ` Javier Pello
2022-09-14 21:23         ` [PATCH 0/6] Remove legacy hwcaps support Joseph Myers
2022-09-17 14:17         ` [PATCH v2 " Javier Pello
2022-09-17 14:18           ` [PATCH v2 1/6] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
2022-09-22 11:46             ` Florian Weimer
2022-09-17 14:19           ` [PATCH v2 2/6] elf: Remove legacy hwcaps support from ldconfig Javier Pello
2022-09-22 12:14             ` Florian Weimer
2022-09-17 14:20           ` [PATCH v2 3/6] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
2022-09-22 16:02             ` Florian Weimer
2022-09-17 14:22           ` [PATCH v2 4/6] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
2022-09-22 16:03             ` Florian Weimer
2022-09-17 14:23           ` [PATCH v2 5/6] elf: Remove _dl_string_hwcap Javier Pello
2022-09-17 14:24           ` [PATCH v2 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
2022-09-21 16:26           ` [PATCH v2 0/6] Remove legacy hwcaps support Joseph Myers
2022-09-27 18:03           ` [PATCH v3 0/8] " Javier Pello
2022-09-27 18:05             ` [PATCH v3 1/8] x86_64: Remove platform directory library loading test Javier Pello
2022-10-03 14:56               ` Adhemerval Zanella Netto
2022-10-04 17:53                 ` Javier Pello
2022-10-04 17:59                   ` Adhemerval Zanella Netto
2022-09-27 18:05             ` [PATCH v3 2/8] elf: Remove legacy hwcaps support from the dynamic loader Javier Pello
2022-09-27 18:06             ` [PATCH v3 3/8] elf: Remove legacy hwcaps support from ldconfig Javier Pello
2022-10-03 15:31               ` Adhemerval Zanella Netto
2022-09-27 18:07             ` [PATCH v3 4/8] elf: Remove hwcap parameter from add_to_cache signature Javier Pello
2022-09-27 18:08             ` [PATCH v3 5/8] elf: Remove hwcap and bits_hwcap fields from struct cache_entry Javier Pello
2022-09-27 18:08             ` [PATCH v3 6/8] Add NEWS entry for legacy hwcaps removal Javier Pello
2022-10-03 15:44               ` Adhemerval Zanella Netto
2022-10-03 19:29                 ` Andreas Schwab
2022-10-03 19:49                   ` Adhemerval Zanella Netto
2022-10-03 19:59                     ` Florian Weimer
2022-10-04 18:00                       ` Adhemerval Zanella Netto
2022-10-05 18:12                         ` Javier Pello
2022-10-06 11:03                           ` Adhemerval Zanella Netto
2022-09-27 18:09             ` [PATCH v3 7/8] elf: Remove _dl_string_hwcap Javier Pello
2022-10-03 16:52               ` Adhemerval Zanella Netto
2022-09-27 18:10             ` [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help Javier Pello
2022-10-03 17:02               ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).