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>
This commit is contained in:
Stefan Liebler 2024-02-05 14:22:06 +01:00
parent 1e25112dc0
commit fa3eb7d5e7
2 changed files with 2 additions and 0 deletions

View File

@ -31,3 +31,4 @@ __strcpy_chk (char *dest, const char *src, size_t destlen)
return memcpy (dest, src, len + 1); return memcpy (dest, src, len + 1);
} }
libc_hidden_builtin_def (__strcpy_chk)

View File

@ -215,6 +215,7 @@ libc_hidden_builtin_proto (__mempcpy_chk)
libc_hidden_builtin_proto (__memset_chk) libc_hidden_builtin_proto (__memset_chk)
libc_hidden_builtin_proto (__stpcpy_chk) libc_hidden_builtin_proto (__stpcpy_chk)
libc_hidden_builtin_proto (__strncpy_chk) libc_hidden_builtin_proto (__strncpy_chk)
libc_hidden_builtin_proto (__strcpy_chk)
#endif #endif