public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Stefan Liebler <stli@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] string: Add hidden builtin definition for __strcpy_chk.
Date: Tue,  6 Feb 2024 08:17:47 +0000 (GMT)	[thread overview]
Message-ID: <20240206081747.48E593858C2C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fa3eb7d5e7d32ca1ad48b48a7eb6d15b8382c3a7

commit fa3eb7d5e7d32ca1ad48b48a7eb6d15b8382c3a7
Author: Stefan Liebler <stli@linux.ibm.com>
Date:   Mon Feb 5 14:22:06 2024 +0100

    string: Add hidden builtin definition for __strcpy_chk.
    
    Otherwise on at least x86_64 and s390x there is an unwanted PLT entry
    in libc.so when configured with --enable-fortify-source=3 and build
    with -Os.
    
    This is observed in elf/check-localplt
    Extra PLT reference: libc.so: __strcpy_chk
    
    The call to PLT entry is in inet/ruserpass.c.
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 debug/strcpy_chk.c | 1 +
 include/string.h   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/debug/strcpy_chk.c b/debug/strcpy_chk.c
index e54780ddde..dd2c453417 100644
--- a/debug/strcpy_chk.c
+++ b/debug/strcpy_chk.c
@@ -31,3 +31,4 @@ __strcpy_chk (char *dest, const char *src, size_t destlen)
 
   return memcpy (dest, src, len + 1);
 }
+libc_hidden_builtin_def (__strcpy_chk)
diff --git a/include/string.h b/include/string.h
index 86d1fa4abe..3b4c6007d7 100644
--- a/include/string.h
+++ b/include/string.h
@@ -215,6 +215,7 @@ libc_hidden_builtin_proto (__mempcpy_chk)
 libc_hidden_builtin_proto (__memset_chk)
 libc_hidden_builtin_proto (__stpcpy_chk)
 libc_hidden_builtin_proto (__strncpy_chk)
+libc_hidden_builtin_proto (__strcpy_chk)
 
 #endif

                 reply	other threads:[~2024-02-06  8:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206081747.48E593858C2C@sourceware.org \
    --to=stli@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).