]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Do not pass GLRO(dl_platform), GLRO(dl_platformlen) to _dl_important_hwcaps
authorFlorian Weimer <fweimer@redhat.com>
Fri, 9 Oct 2020 08:13:14 +0000 (10:13 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 9 Oct 2020 08:22:19 +0000 (10:22 +0200)
In the current code, the function can easily obtain the information
on its own.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
elf/dl-hwcaps.c
elf/dl-load.c
sysdeps/generic/ldsodefs.h

index 6df9efb2558b759b0bcfb81f80bf217f77e75b7a..44dbac099fda1a2145eb6daf983de84fb5137ed5 100644 (file)
 
 /* Return an array of useful/necessary hardware capability names.  */
 const struct r_strlenpair *
-_dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
-                     size_t *max_capstrlen)
+_dl_important_hwcaps (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 = platform != NULL;
+  size_t cnt = GLRO (dl_platform) != NULL;
   size_t n, m;
   size_t total;
   struct r_strlenpair *result;
@@ -60,10 +59,10 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
        masked ^= 1ULL << n;
        ++m;
       }
-  if (platform != NULL)
+  if (GLRO (dl_platform) != NULL)
     {
-      temp[m].str = platform;
-      temp[m].len = platform_len;
+      temp[m].str = GLRO (dl_platform);
+      temp[m].len = GLRO (dl_platformlen);
       ++m;
     }
 
index 0c8fa72c4d1d2396f956ce3eb64c02b425b6fd22..f3201e7c14424a736da9d4b8fbff247664010076 100644 (file)
@@ -697,8 +697,7 @@ _dl_init_paths (const char *llp, const char *source)
 
 #ifdef SHARED
   /* Get the capabilities.  */
-  capstr = _dl_important_hwcaps (GLRO(dl_platform), GLRO(dl_platformlen),
-                                &ncapstr, &max_capstrlen);
+  capstr = _dl_important_hwcaps (&ncapstr, &max_capstrlen);
 #endif
 
   /* First set up the rest of the default search directory entries.  */
index 510a2f68412dba16915dc93e9e6b0368ec8b8bea..382eeb9be0d35725027290b1bfbb59fdc01061da 100644 (file)
@@ -1071,12 +1071,12 @@ extern void _dl_show_auxv (void) attribute_hidden;
    other.  */
 extern char *_dl_next_ld_env_entry (char ***position) attribute_hidden;
 
-/* Return an array with the names of the important hardware capabilities.  */
-extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform,
-                                                       size_t paltform_len,
-                                                       size_t *sz,
-                                                       size_t *max_capstrlen)
-     attribute_hidden;
+/* Return an array with the names of the important hardware
+   capabilities.  The length of the array is written to *SZ, and the
+   maximum of all strings length is written to *MAX_CAPSTRLEN.  */
+const struct r_strlenpair *_dl_important_hwcaps (size_t *sz,
+                                                size_t *max_capstrlen)
+  attribute_hidden;
 
 /* Look up NAME in ld.so.cache and return the file name stored there,
    or null if none is found.  Caller must free returned string.  */