aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-10-09 10:13:14 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-10-09 10:22:19 +0200
commitbb5fd5ce64b598085bdb8a05cb53777480fe093c (patch)
treeeeaf58f2f0530b07d314d1c7d1d89b20b70da9db /elf
parent647103ea3a2aae2e6791b3bebe9e33eedc168102 (diff)
downloadglibc-bb5fd5ce64b598085bdb8a05cb53777480fe093c.zip
glibc-bb5fd5ce64b598085bdb8a05cb53777480fe093c.tar.gz
glibc-bb5fd5ce64b598085bdb8a05cb53777480fe093c.tar.bz2
elf: Do not pass GLRO(dl_platform), GLRO(dl_platformlen) to _dl_important_hwcaps
In the current code, the function can easily obtain the information on its own. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-hwcaps.c11
-rw-r--r--elf/dl-load.c3
2 files changed, 6 insertions, 8 deletions
diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 6df9efb..44dbac0 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -28,13 +28,12 @@
/* 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;
}
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0c8fa72..f3201e7 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -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. */