From patchwork Fri Oct 28 17:35:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 59599 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7605538245A5 for ; Fri, 28 Oct 2022 17:39:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7605538245A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666978744; bh=iJ/vKC1DYKIVR7P+lLG4GLkGBD93cGv/5QhrLk6OSmA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=skFyuMkjV7FQk3UnVm1rhkN0ROu5vsglnq3qKgUIDfcJKcihhsaJEBE1kiFHwVdJX i7bSpdGBXnmqKbeFmN8AI0QBTghqJkNGiQGyjAVPJMyGD8oZ/wc6PHtsBeAYSbmeDy EMxpvnuuiXqF3IVmq5CFYs4hh77ppyv/EeW8dOtQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id DD2853857838 for ; Fri, 28 Oct 2022 17:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD2853857838 Received: by mail-ot1-x32e.google.com with SMTP id r13-20020a056830418d00b0065601df69c0so3355758otu.7 for ; Fri, 28 Oct 2022 10:35:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iJ/vKC1DYKIVR7P+lLG4GLkGBD93cGv/5QhrLk6OSmA=; b=7DzAvOZ0DFzJ6n3Ql+8uBGaeKNTaYhrT4P0TCBDughgh0X+VSMCO7v23CpAP+G/6oE g85ETtCIOTkKcoJZZ5bfk/wLADM8/Iz3Q0bERDgcqtlU1tbPj9A5GugmNU8Hh2I3DojG bEYDX6KDruP/gqymMJZUV9aydsJpQ/gkenv130OHP0CN/idBq9AbZw0owRwr/ypFsNpj +rvH4Sud+SI4n92/+CUEZYIOJN0NTiGm//mP8aGbNmYGeUZ/S87g3Gc0In42ttvFBHZB iLJNgStNktLPLLKDVFn+n4ziugvIFjEt+ZkvGtIqzR+SXEyrtZ8lyu5XYRupumuFLl1I hs3Q== X-Gm-Message-State: ACrzQf18pcqyYNrYA790iqbyjYa3Nde04p1EBqUOsxEpNDCldrVmoCjt ss3ZyFQh28025nTooO1DmgI3+jRHgXoWjQu1 X-Google-Smtp-Source: AMsMyM4VZnHesToKq3bjg1cvEkvqiIbz4VmL/538ianeN+xwEZQaZ1M3GsMyJTeB63KsbzwJ7qqlmw== X-Received: by 2002:a9d:73c5:0:b0:662:17a1:2304 with SMTP id m5-20020a9d73c5000000b0066217a12304mr241446otk.192.1666978553030; Fri, 28 Oct 2022 10:35:53 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:17c8:6484:1100:1451:7f3f]) by smtp.gmail.com with ESMTPSA id v10-20020a056870b50a00b0012779ba00fesm2434998oap.2.2022.10.28.10.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 10:35:52 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 10/11] allocate_once: Apply asm redirection before first use Date: Fri, 28 Oct 2022 14:35:31 -0300 Message-Id: <20221028173532.876027-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028173532.876027-1-adhemerval.zanella@linaro.org> References: <20221028173532.876027-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Compilers may not be able to apply asm redirections to functions after these functions are used for the first time, e.g. clang 13. Reviewed-by: Fangrui Song --- include/allocate_once.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/allocate_once.h b/include/allocate_once.h index a487d641d5..d8cc08824c 100644 --- a/include/allocate_once.h +++ b/include/allocate_once.h @@ -27,6 +27,9 @@ void *__libc_allocate_once_slow (void **__place, void (*__deallocate) (void *__closure, void *__ptr), void *__closure); +#ifndef _ISOMAC +libc_hidden_proto (__libc_allocate_once_slow) +#endif /* Return an a pointer to an allocated and initialized data structure. If this function returns a non-NULL value, the caller can assume @@ -88,8 +91,4 @@ allocate_once (void **__place, void *(*__allocate) (void *__closure), __closure); } -#ifndef _ISOMAC -libc_hidden_proto (__libc_allocate_once_slow) -#endif - #endif /* _ALLOCATE_ONCE_H */