aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2024-02-21 14:12:12 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2024-02-21 14:18:10 +0000
commit2f4cbf459d4af41977be30eab2f6f7d7e9f9b5b5 (patch)
treedc6420caad294efa2d4df5fda60cb6bcd1515367 /lib/libsys
parent58df49801d9d58e61cc2adc8fd1e6848b64d2453 (diff)
downloadsrc-2f4cbf459d4af41977be30eab2f6f7d7e9f9b5b5.tar.gz
src-2f4cbf459d4af41977be30eab2f6f7d7e9f9b5b5.zip
Diffstat (limited to 'lib/libsys')
-rw-r--r--lib/libsys/auxv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libsys/auxv.c b/lib/libsys/auxv.c
index 88f49ef53be1..1a4fd352950e 100644
--- a/lib/libsys/auxv.c
+++ b/lib/libsys/auxv.c
@@ -36,6 +36,7 @@
#include <sys/auxv.h>
#include "un-namespace.h"
#include "libc_private.h"
+#include <machine/atomic.h>
extern int _DYNAMIC;
#pragma weak _DYNAMIC
@@ -66,7 +67,7 @@ __init_elf_aux_vector(void)
}
#endif
-static bool aux_once = false;
+static int aux_once;
static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags;
static int hwcap_present, hwcap2_present;
static char *canary, *pagesizes, *execpath;
@@ -92,7 +93,7 @@ init_aux(void)
{
Elf_Auxinfo *aux;
- if (aux_once)
+ if (atomic_load_acq_int(&aux_once))
return;
for (aux = __elf_aux_vector; aux->a_type != AT_NULL; aux++) {
switch (aux->a_type) {
@@ -179,7 +180,7 @@ init_aux(void)
_init_aux_powerpc_fixup();
#endif
- aux_once = true;
+ atomic_store_rel_int(&aux_once, 1);
}
#ifdef __powerpc__