From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dog.elm.relay.mailchannels.net (dog.elm.relay.mailchannels.net [23.83.212.48]) by sourceware.org (Postfix) with ESMTPS id 273263870F30 for ; Fri, 30 Jun 2023 15:09:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 273263870F30 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8863A5C09A4; Fri, 30 Jun 2023 15:09:19 +0000 (UTC) Received: from pdx1-sub0-mail-a286.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E34725C1E28; Fri, 30 Jun 2023 15:09:17 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1688137757; a=rsa-sha256; cv=none; b=mGFgxFQJSm1nQAJG5SK1pX1DD3LMkeUVcjoh8ndcy2OYIiik2Pm36icb2aUJfB/U0RSPPM x1eyFjzXCBPEkawP11cW5R1ptQ+MTGRzQnyZ2ItMPw2D7ZcYREm2ILNmz7mpRwD2SkgHOR GhPcwHk8nMM1UrYuFu2ZgHsuGyHYzzkeC2tvIyzVKiCbwWaLDxTlYODgdIB13qhwfB8e3a Pt8ie2nxFRelP5sjYT3MyZrTcWEbaKQchm6PoAK1io+FCoxK7LpOTMNh4NjWR6IgnHdDac pa1LZjV5Ohh6N7vitBnEfKH3dcIkeGoYGoXFRyWTEeUdc1DE7RwB/9N6pJxDHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1688137757; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=m/su1Ntq3l9HjuvBsZOMs3xClc71SKv3jCkuU6Mo8Ls=; b=Nl/0mAwuPNfaivSGg897PKsy0ZdoQkh++3HAZoyWF/UkJKOhtRMdV345cyAq5SfH9X/0BA OWKodU8LqSJbBluME6bu/k9S+bfcN/odfsDS8u+831eM5PqFEhMRpuM6l00TQAeGy0eWf8 H1lcbMKT3V1qiTyJZE5oDGPYdTWyREmqcYGdSjF3GSgAMinQCYIemrFPVFLde97LzI7nhT 6C3WDVFcX7WwtXI8wDjT1+iTnuBxlMnA5Wf9GdhGSG+CYG4o1vvoHZ6fbPejuBDiXgu/W8 46wkgagQRnX86zm4I3hi0AVd+tp4A/q647DmaFql32WA+Ir9tFBUh8qzg3b4JQ== ARC-Authentication-Results: i=1; rspamd-85899d6fcc-hn6x5; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Wide-Eyed-Tangy: 23aa711344014125_1688137759358_3499955209 X-MC-Loop-Signature: 1688137759358:3318422035 X-MC-Ingress-Time: 1688137759358 Received: from pdx1-sub0-mail-a286.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.193.136 (trex/6.9.1); Fri, 30 Jun 2023 15:09:19 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-09-174-91-45-44.dsl.bell.ca [174.91.45.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a286.dreamhost.com (Postfix) with ESMTPSA id 4QszHd2bTsz7v; Fri, 30 Jun 2023 08:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1688137757; bh=m/su1Ntq3l9HjuvBsZOMs3xClc71SKv3jCkuU6Mo8Ls=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=QaGXtIdLR6MaZK/D0oqeF0ZuiZcT6/iwvqDKiD0HeK5x0BfwjcjO3kzuvx7H+K85B 7kW/ok0xwCQLS1ewaglYO9D+WoA2bSfKNZMJFIETtH0Jviv19A+10z7+avRD3IWqqP 01ST9+1j3FDX0bIOAxZsjECV5lxwRSVPXCNN4sXQ3cyMoxMD642D+P3Q3JjLHPwIGP orlQluduPqI75hm8yli2Jp/o64XQiMSL6RKz9jrzlcaD6sg1CaiEQYzoqo87y15lnL N/Cfq7pB6P+kutN+vSMxDn+cG8k4dURzfFeZIKr5QfAi1hpokidjRWoTM0xYXn7rCs MeKM86SZ/aMdA== Message-ID: Date: Fri, 30 Jun 2023 11:09:16 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 05/16] stdio: Ensure *_chk routines have their hidden builtin definition available Content-Language: en-US To: =?UTF-8?B?RnLDqWTDqXJpYyBCw6lyYXQ=?= , libc-alpha@sourceware.org, Rajalakshmi Srinivasaraghavan References: <20230628084246.778302-1-fberat@redhat.com> <20230628084246.778302-6-fberat@redhat.com> From: Siddhesh Poyarekar In-Reply-To: <20230628084246.778302-6-fberat@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3036.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,URIBL_BLACK 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: On 2023-06-28 04:42, Frédéric Bérat wrote: > If libc_hidden_builtin_{def,proto} isn't properly set for *_chk routines, > there are unwanted PLT entries in libc.so. > --- LGTM, but also pulling in Raji for a review of the ldbl bits. Reviewed-by: Siddhesh Poyarekar > debug/asprintf_chk.c | 4 +++- > debug/fgets_u_chk.c | 1 + > debug/fprintf_chk.c | 1 + > debug/sprintf_chk.c | 1 + > include/stdio.h | 8 +++++++- > sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf_chk.c | 1 + > sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf_chk.c | 1 + > sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c | 1 + > sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c | 1 + > 9 files changed, 17 insertions(+), 2 deletions(-) > > diff --git a/debug/asprintf_chk.c b/debug/asprintf_chk.c > index 651c2cd76b..06d112de00 100644 > --- a/debug/asprintf_chk.c > +++ b/debug/asprintf_chk.c > @@ -22,7 +22,7 @@ > /* Write formatted output from FORMAT to a string which is > allocated with malloc and stored in *STRING_PTR. */ > int > -__asprintf_chk (char **result_ptr, int flag, const char *format, ...) > +___asprintf_chk (char **result_ptr, int flag, const char *format, ...) > { > /* For flag > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n > can only come from read-only format strings. */ > @@ -36,3 +36,5 @@ __asprintf_chk (char **result_ptr, int flag, const char *format, ...) > > return ret; > } > +ldbl_hidden_def (___asprintf_chk, __asprintf_chk) > +ldbl_strong_alias (___asprintf_chk, __asprintf_chk) > diff --git a/debug/fgets_u_chk.c b/debug/fgets_u_chk.c > index a16ba655e6..74275381f5 100644 > --- a/debug/fgets_u_chk.c > +++ b/debug/fgets_u_chk.c > @@ -56,3 +56,4 @@ __fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp) > fp->_flags |= old_error; > return result; > } > +libc_hidden_builtin_def (__fgets_unlocked_chk) > diff --git a/debug/fprintf_chk.c b/debug/fprintf_chk.c > index b57d538d03..273051ef91 100644 > --- a/debug/fprintf_chk.c > +++ b/debug/fprintf_chk.c > @@ -35,4 +35,5 @@ ___fprintf_chk (FILE *fp, int flag, const char *format, ...) > > return ret; > } > +ldbl_hidden_def (___fprintf_chk, __fprintf_chk) > ldbl_strong_alias (___fprintf_chk, __fprintf_chk) > diff --git a/debug/sprintf_chk.c b/debug/sprintf_chk.c > index b27f4afae8..e45f1e7b3b 100644 > --- a/debug/sprintf_chk.c > +++ b/debug/sprintf_chk.c > @@ -42,4 +42,5 @@ ___sprintf_chk (char *s, int flag, size_t slen, const char *format, ...) > > return ret; > } > +ldbl_hidden_def (___sprintf_chk, __sprintf_chk) > ldbl_strong_alias (___sprintf_chk, __sprintf_chk) > diff --git a/include/stdio.h b/include/stdio.h > index da47d1ce99..3afb0ff77b 100644 > --- a/include/stdio.h > +++ b/include/stdio.h > @@ -276,7 +276,13 @@ extern FILE *__open_memstream (char **, size_t *) __THROW __wur; > libc_hidden_proto (__open_memstream) > libc_hidden_proto (__libc_fatal) > rtld_hidden_proto (__libc_fatal) > -libc_hidden_proto (__vsprintf_chk) > + > +libc_hidden_proto (__fgets_unlocked_chk) > + > +libc_hidden_ldbl_proto (__asprintf_chk) > +libc_hidden_ldbl_proto (__fprintf_chk) > +libc_hidden_ldbl_proto (__sprintf_chk) > +libc_hidden_ldbl_proto (__vsprintf_chk) > > extern FILE * __fmemopen (void *buf, size_t len, const char *mode); > libc_hidden_proto (__fmemopen) > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf_chk.c > index fbf953a728..6e93ee81fc 100644 > --- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf_chk.c > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf_chk.c > @@ -35,4 +35,5 @@ ___ieee128___asprintf_chk (char **string_ptr, int flag, const char *format, ...) > > return done; > } > +hidden_def (___ieee128___asprintf_chk) > strong_alias (___ieee128___asprintf_chk, __asprintf_chkieee128) > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf_chk.c > index bd10e9c3db..e0865b6663 100644 > --- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf_chk.c > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf_chk.c > @@ -35,4 +35,5 @@ ___ieee128___fprintf_chk (FILE *fp, int flag, const char *format, ...) > > return done; > } > +hidden_def (___ieee128___fprintf_chk) > strong_alias (___ieee128___fprintf_chk, __fprintf_chkieee128) > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c > index 0039c3b53d..762757a5c7 100644 > --- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c > @@ -43,4 +43,5 @@ ___ieee128___sprintf_chk (char *s, int flag, size_t slen, > > return done; > } > +hidden_def (___ieee128___sprintf_chk) > strong_alias (___ieee128___sprintf_chk, __sprintf_chkieee128) > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c > index 22137269c0..c251b60d4e 100644 > --- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c > @@ -35,4 +35,5 @@ ___ieee128___vsprintf_chk (char *string, int flag, size_t slen, > > return __vsprintf_internal (string, slen, format, ap, mode); > } > +hidden_def (___ieee128___vsprintf_chk) > strong_alias (___ieee128___vsprintf_chk, __vsprintf_chkieee128)