From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id 4DD7E3857C40 for ; Fri, 28 Oct 2022 17:35:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DD7E3857C40 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-13be3ef361dso7009216fac.12 for ; Fri, 28 Oct 2022 10:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fOgwmZRKuABNCgz2MbGPpTsskDZKnN6uPiVpbfetxLY=; b=bLOpsGGDO5QCwOjqKAUCzTGzNZCbcdLC0Csa6KmZrDjN/Eg8G+7jwlPcIWmoYzPyI2 RnuNfRUN7LH4VHGufwQGHC01Z2udsP5a/uZy+VRh8nQOhQmL7aLwS2pKT5+sQHjPoLOM jl6mCP7SKd/ybVW5wTDBFhYgIwDGz8QrgIMVp0xCxltufQEhjeoLmkeDBVrBoxi7+3Nu qeytXJzPPpPi5N8q2UVu2AhJJi9NOEayq1umhhceOJ0tjNMn9CzGvcI0gbPo2fVj809U QVY+OP5wrFZK/hvzWsd+HyNd8ofuDvTZqEy5NaWU06BSbMRo9O1dXqsArVVhF0MOZLp0 tDGA== 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=fOgwmZRKuABNCgz2MbGPpTsskDZKnN6uPiVpbfetxLY=; b=UfMZ1pqOSBcjMhcAozoEQYraQh9hWq9j5VZIY3JWnI/dvWN00WGlzxW1dJarfy0UHf hx8eGTKA5AezXxazE/58hdn9coSO7Is7vWXkuhiFWDZC2H14BhHpmOsgIc0OUqvjBItl SqRvZSDEFcv9+ZAMpF423UkYnJeRIeJBIIB7pef1BNo4wDDsr9yohS0S0Yy0GGe+bXtX 62t8xGDpyoe/TcjV6sp/cvDQ46TfWGEtrXRL0uP2tkdl/COEqMlc6AZAeZnmYERcEh7g UgpqqqRcGVQPZufcnFwv6E1BE+c/cW5aC1gjVSwOjlzDiCIXmyhWFrXew4Hjtcfws95r 8ryg== X-Gm-Message-State: ACrzQf3ovUhzuld4BxV3rqmk29P5IpSY5EJn808A6wvGQ6HOgRSw975L O/6tBhxbEZGKHeKzfrqJNB2pm9DmSt3UB4Yr X-Google-Smtp-Source: AMsMyM6PvJQwD+wjbtXsciWRBRp87yYbptfKsSkSIFRAqAgYBJHyVBybUmdqGy4LUTCXP6M95ThbEA== X-Received: by 2002:a05:6871:79f:b0:13c:265b:75d2 with SMTP id o31-20020a056871079f00b0013c265b75d2mr8353932oap.175.1666978551837; Fri, 28 Oct 2022 10:35:51 -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.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 10:35:51 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 09/11] alloc_buffer: Apply asm redirection before first use Date: Fri, 28 Oct 2022 14:35:30 -0300 Message-Id: <20221028173532.876027-10-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 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 List-Id: Compilers may not be able to apply asm redirections to functions after these functions are used for the first time, e.g. clang 13. --- include/alloc_buffer.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/include/alloc_buffer.h b/include/alloc_buffer.h index 1c1dbe0a46..553de607e8 100644 --- a/include/alloc_buffer.h +++ b/include/alloc_buffer.h @@ -114,6 +114,9 @@ enum /* Internal function. Terminate the process using __libc_fatal. */ void __libc_alloc_buffer_create_failure (void *start, size_t size); +#ifndef _ISOMAC +libc_hidden_proto (__libc_alloc_buffer_create_failure) +#endif /* Create a new allocation buffer. The byte range from START to START + SIZE - 1 must be valid, and the allocation buffer allocates @@ -132,6 +135,9 @@ alloc_buffer_create (void *start, size_t size) /* Internal function. See alloc_buffer_allocate below. */ struct alloc_buffer __libc_alloc_buffer_allocate (size_t size, void **pptr) __attribute__ ((nonnull (2))); +#ifndef _ISOMAC +libc_hidden_proto (__libc_alloc_buffer_allocate) +#endif /* Allocate a buffer of SIZE bytes using malloc. The returned buffer is in a failed state if malloc fails. *PPTR points to the start of @@ -333,6 +339,9 @@ void * __libc_alloc_buffer_alloc_array (struct alloc_buffer *buf, size_t size, size_t align, size_t count) __attribute__ ((nonnull (1))); +#ifndef _ISOMAC +libc_hidden_proto (__libc_alloc_buffer_alloc_array) +#endif /* Obtain a TYPE * pointer to an array of COUNT objects in BUF of TYPE. Consume these bytes from the buffer. Return NULL and mark @@ -349,6 +358,9 @@ void * __libc_alloc_buffer_alloc_array (struct alloc_buffer *buf, struct alloc_buffer __libc_alloc_buffer_copy_bytes (struct alloc_buffer, const void *, size_t) __attribute__ ((nonnull (2))); +#ifndef _ISOMAC +libc_hidden_proto (__libc_alloc_buffer_copy_bytes) +#endif /* Copy SIZE bytes starting at SRC into the buffer. If there is not enough room in the buffer, the buffer is marked as failed. No @@ -363,6 +375,9 @@ alloc_buffer_copy_bytes (struct alloc_buffer *buf, const void *src, size_t size) struct alloc_buffer __libc_alloc_buffer_copy_string (struct alloc_buffer, const char *) __attribute__ ((nonnull (2))); +#ifndef _ISOMAC +libc_hidden_proto (__libc_alloc_buffer_copy_string) +#endif /* Copy the string at SRC into the buffer, including its null terminator. If there is not enough room in the buffer, the buffer @@ -377,12 +392,4 @@ alloc_buffer_copy_string (struct alloc_buffer *buf, const char *src) return result; } -#ifndef _ISOMAC -libc_hidden_proto (__libc_alloc_buffer_alloc_array) -libc_hidden_proto (__libc_alloc_buffer_allocate) -libc_hidden_proto (__libc_alloc_buffer_copy_bytes) -libc_hidden_proto (__libc_alloc_buffer_copy_string) -libc_hidden_proto (__libc_alloc_buffer_create_failure) -#endif - #endif /* _ALLOC_BUFFER_H */ -- 2.34.1