summaryrefslogtreecommitdiff
path: root/libc/elf/ldconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/elf/ldconfig.c')
-rw-r--r--libc/elf/ldconfig.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/elf/ldconfig.c b/libc/elf/ldconfig.c
index 57c6a6f04..13f262d65 100644
--- a/libc/elf/ldconfig.c
+++ b/libc/elf/ldconfig.c
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <stdint.h>
#include <sys/fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
@@ -173,13 +174,17 @@ is_hwcap_platform (const char *name)
{
int hwcap_idx = _dl_string_hwcap (name);
+ /* Is this a normal hwcap for the machine e.g. fpu? */
if (hwcap_idx != -1 && ((1 << hwcap_idx) & hwcap_mask))
return 1;
+ /* ... Or is it a platform pseudo-hwcap e.g. i686? */
hwcap_idx = _dl_string_platform (name);
if (hwcap_idx != -1)
return 1;
+ /* ... Or is this one of the extra pseudo-hwcaps that we map beyond
+ _DL_FIRST_EXTRA e.g. tls, or nosegneg? */
for (hwcap_idx = _DL_FIRST_EXTRA; hwcap_idx < 64; ++hwcap_idx)
if (hwcap_extra[hwcap_idx - _DL_FIRST_EXTRA] != NULL
&& !strcmp (name, hwcap_extra[hwcap_idx - _DL_FIRST_EXTRA]))
@@ -1265,6 +1270,8 @@ main (int argc, char **argv)
add_dir (argv[i]);
}
+ /* The last entry in hwcap_extra is reserved for the "tls"
+ pseudo-hwcap which indicates support for TLS. */
hwcap_extra[63 - _DL_FIRST_EXTRA] = "tls";
set_hwcap ();