From nobody Wed Feb 21 14:19:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfz0j4YgNz5CGPd; Wed, 21 Feb 2024 14:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfz0j3sJtz4krg; Wed, 21 Feb 2024 14:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708525141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S2CuHsh/b2dgCS1+/wyvY88r+hvJggCKFILtiF247qU=; b=uSDr1/gvTuBYmMOK8ZLu4dz6HykoG6wGIxzcbswkOMKtV7q6cuOKTwwFSo4Xc0uRHAJeDa ha+BYsgxAu8Kg3pGmgve2dbt3/gvF0HIz1jfYzIJSyVs2ohSn/4luYKuzBRcLoaZx5c/z3 rsizGtEz1viMZoNdAyDT2C/TgMqs3nwPGNxEE+zje8CEvaWcEY8tuyZKQeWNGWH4jVzuhZ 6SIiOsKWp2cBkQKQYJbDDS+0X758VbgK/UOwAlDTe9B181N4tbYzIW9nrR+L8DpBS4WKhH PEq1ziFpYsBLjFD2EVoS8OnJ5UrVufPmr3YVzR1MKsg4mkFOzp6k0dKaf416Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708525141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S2CuHsh/b2dgCS1+/wyvY88r+hvJggCKFILtiF247qU=; b=tfWu4AaOVjL4dlSTvmZQBEkJDgUSP9q4ovjt7ZjHfNEeLp1VJrNxY3VveMlPtYdPC7Cgtf dphNnuzRzSqUBI5j4fiVg0UyP3WbxRX9/oBWReETsNAYaPQkOkxToYZqJ32olOUvQ5i3X9 lttVQG7gwiWDywsStKtgnptfUUuULTCA3WvqVGLh0WLrB5qRulfM5wuV3daq6z+nQkCHJj A/uQe6Z8agcIc3DQlmcso5VC+HW9Lz64b3jd3g2ri+X1WrGx8QlA2gDIKmNhyBIO0+wQ7l mIuBeUUxHovcHbCuFMvJgYMKaLRPvuRaPwCco/RzGBtU/Pgu4mA6X6bf3UESrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708525141; a=rsa-sha256; cv=none; b=AKRZ6qY6cyxEHt/7pzZqsCiSy427+yuEpiBVXYxptFJv6kZiKyZU0nXJ7W5ggbve3d08mB ojZ3ONvC3ywaLM6Ue/+He4nwYb7gqFl3Bjroowq4shgg7OXvPbdXJWqgcXjgxEgqq7gf4r L4rydg42YV3VFA7rBSdyWFIHj09RJ3rSPNbFZxUe1SALCKTgYb5hhUn5NTEeIp7+6Watmh l0DRmehG+BQVf25jME+t7dpp5eOmm/gJf4wiwMBA6m7LR+CdxobxQH6VDaUkIKugUZUujH jgykxnJVBnjOcgq6Nyj94rqyzzmXeoP0midWZlwY0WkAcV9MX9QiQHulUYlPvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfz0j2yQZz15dM; Wed, 21 Feb 2024 14:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LEJ1xN000740; Wed, 21 Feb 2024 14:19:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LEJ19I000737; Wed, 21 Feb 2024 14:19:01 GMT (envelope-from git) Date: Wed, 21 Feb 2024 14:19:01 GMT Message-Id: <202402211419.41LEJ19I000737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2f4cbf459d4a - main - libsys auxv.c: add fences needed to ensure that flag works List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f4cbf459d4af41977be30eab2f6f7d7e9f9b5b5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2f4cbf459d4af41977be30eab2f6f7d7e9f9b5b5 commit 2f4cbf459d4af41977be30eab2f6f7d7e9f9b5b5 Author: Konstantin Belousov AuthorDate: 2024-02-21 14:12:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-21 14:18:10 +0000 libsys auxv.c: add fences needed to ensure that flag works Noted by: jrtc27 Sponsored by: The FreeBSD Foundation --- lib/libsys/auxv.c | 7 ++++--- 1 file 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 #include "un-namespace.h" #include "libc_private.h" +#include 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__