From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 122581F5AE for ; Fri, 24 Jul 2020 09:39:18 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE222388C013; Fri, 24 Jul 2020 09:39:16 +0000 (GMT) Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) by sourceware.org (Postfix) with ESMTPS id 2DD843857C71 for ; Fri, 24 Jul 2020 09:39:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2DD843857C71 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4BCkg32yfXz1rwbJ; Fri, 24 Jul 2020 11:39:11 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4BCkg32c4dz1qy6Q; Fri, 24 Jul 2020 11:39:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id bWUvZNYImQAa; Fri, 24 Jul 2020 11:39:08 +0200 (CEST) X-Auth-Info: d3kfZ6pFR1gXUKrVJjPPhMlf6aVK6UYt2WGip75xcDI= Received: from jawa (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 24 Jul 2020 11:39:08 +0200 (CEST) Date: Fri, 24 Jul 2020 11:39:07 +0200 From: Lukasz Majewski To: Adhemerval Zanella Subject: Re: [PATCH 13/16] linux: Disentangle fstatat from fxstatat Message-ID: <20200724113907.3a347903@jawa> In-Reply-To: <20200723194641.1949404-14-adhemerval.zanella@linaro.org> References: <20200723194641.1949404-1-adhemerval.zanella@linaro.org> <20200723194641.1949404-14-adhemerval.zanella@linaro.org> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/zttFzK7W.REMfNUqvnPNqw0"; protocol="application/pgp-signature" 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: , Cc: Alistair Francis , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --Sig_/zttFzK7W.REMfNUqvnPNqw0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 23 Jul 2020 16:46:38 -0300 Adhemerval Zanella wrote: > It implements all the requires syscall for the all Linux kABIS on > fstatat{64} itself instead of calling fxstatat{64}. >=20 > On non-LFS implementation, it handles 3 cases: >=20 > 1. New kABIs which uses generic pre 64-bit time Linux ABI (csky and > nios): it issues __NR_fstat64 plus handle the overflow on st_ino, > st_size, or st_blocks. >=20 > 2. Old KABIs with old non-LFS support (arm, i386, hppa, m68k, > microblaze, mips32, s390, sh, powerpc, and sparc32): it issues > __NR_fstatat64 and convert the result to struct stat. >=20 > 3. 64-bit kABI outliers (mips64 and mips64-n32): it issues > __NR_newfstatat and convert the result to struct stat. >=20 > The generic LFS implementation handles multiple cases: >=20 > 1. XSTAT_IS_XSTAT64 being 1: >=20 > 1.1. 64-bit kABI (aarch64, ia64, powerpc64*, s390x, riscv64, and > x86_64): it issues __NR_newfstatat. >=20 > 1.2. 64-bit kABI outlier (alpha): it issues __NR_fstatat64. >=20 > 1.3. 64-bit kABI outlier where struct stat64 does not match kernel > one (sparc64): it issues __NR_fstatat64 and convert the > result to struct stat64. >=20 > 1.4. 32-bit kABI with default 64-bit time_t (arc, riscv32): it > issues __NR_statx and convert the result to struct stat64. >=20 > 2. Old ABIs with XSTAT_IS_XSTAT64 being 0: >=20 > 2.1. All kABIs with non-LFS support (arm, csky, i386, hppa, m68k, > microblaze, nios2, sh, powerpc32, and sparc32): it issues > __NR_fstatat64. >=20 > 2.2. 64-bit kABI outliers (mips64 and mips64-n32): it issues > __NR_newfstatat and convert the result to struct stat64. >=20 > It allows to remove all the hidden definitions from the {f,l}xstat{64} > (some are still kept because Hurd requires it). >=20 > Checked with a build for all affected ABIs. I also checked on x86_64, > i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski > --- > include/sys/stat.h | 32 ++++++-- > sysdeps/unix/sysv/linux/alpha/fxstat64.c | 2 - > sysdeps/unix/sysv/linux/alpha/fxstatat64.c | 4 - > sysdeps/unix/sysv/linux/alpha/lxstat64.c | 3 - > sysdeps/unix/sysv/linux/alpha/xstat64.c | 3 - > sysdeps/unix/sysv/linux/fstatat.c | 56 ++++++++++++- > sysdeps/unix/sysv/linux/fstatat64.c | 45 ++++++++++- > sysdeps/unix/sysv/linux/fxstat.c | 1 - > sysdeps/unix/sysv/linux/fxstat64.c | 3 - > sysdeps/unix/sysv/linux/fxstatat.c | 2 - > sysdeps/unix/sysv/linux/fxstatat64.c | 4 +- > sysdeps/unix/sysv/linux/kstat_cp.h | 2 + > sysdeps/unix/sysv/linux/lxstat.c | 1 - > sysdeps/unix/sysv/linux/lxstat64.c | 2 - > sysdeps/unix/sysv/linux/mips/fxstat.c | 1 - > sysdeps/unix/sysv/linux/mips/lxstat.c | 1 - > .../unix/sysv/linux/mips/mips64/fxstat64.c | 2 - > .../unix/sysv/linux/mips/mips64/fxstatat.c | 1 - > .../unix/sysv/linux/mips/mips64/fxstatat64.c | 1 - > .../unix/sysv/linux/mips/mips64/kstat_cp.h | 80 > +++++++++++++++++++ .../unix/sysv/linux/mips/mips64/lxstat64.c | > 2 - sysdeps/unix/sysv/linux/mips/mips64/xstat64.c | 2 - > sysdeps/unix/sysv/linux/mips/xstat.c | 1 - > .../unix/sysv/linux/sparc/sparc64/kstat_cp.h | 46 +++++++++++ > sysdeps/unix/sysv/linux/xstat.c | 1 - > sysdeps/unix/sysv/linux/xstat64.c | 2 - > 26 files changed, 253 insertions(+), 47 deletions(-) > create mode 100644 sysdeps/unix/sysv/linux/kstat_cp.h > create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h > create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h >=20 > diff --git a/include/sys/stat.h b/include/sys/stat.h > index 04b825df4a..199173b007 100644 > --- a/include/sys/stat.h > +++ b/include/sys/stat.h > @@ -3,6 +3,28 @@ > =20 > #ifndef _ISOMAC > # include > +# include > + > +static inline bool > +in_ino_t_range (__ino64_t v) > +{ > + __ino_t s =3D v; > + return s =3D=3D v; > +} > + > +static inline bool > +in_off_t_range (__off64_t v) > +{ > + __off_t s =3D v; > + return s =3D=3D v; > +} > + > +static inline bool > +in_blkcnt_t_range (__blkcnt64_t v) > +{ > + __blkcnt_t s =3D v; > + return s =3D=3D v; > +} > =20 > /* Now define the internal interfaces. */ > extern int __stat (const char *__file, struct stat *__buf); > @@ -54,19 +76,19 @@ int __xstat64 (int ver, const char *__filename, > struct stat64 *__stat_buf); int __lxstat64 (int ver, const char > *__filename, struct stat64 *__stat_buf); int __fxstatat64 (int ver, > int __fildes, const char *__filename, struct stat64 *__stat_buf, int > __flag); + > +# ifdef NO_RTLD_HIDDEN > +/* These are still required for Hurd. */ > libc_hidden_proto (__fxstat); > libc_hidden_proto (__xstat); > libc_hidden_proto (__lxstat); > libc_hidden_proto (__fxstatat); > -# if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) > +# if IS_IN (libc) > hidden_proto (__fxstat64); > hidden_proto (__xstat64); > hidden_proto (__lxstat64); > hidden_proto (__fxstatat64); > -# endif > - > -# ifdef NO_RTLD_HIDDEN > -/* These are still required for Hurd. */ > +# endif > # define stat(fname, buf) __xstat (_STAT_VER, fname, buf) > # define lstat(fname, buf) __lxstat (_STAT_VER, fname, buf) > # define __lstat(fname, buf) __lxstat (_STAT_VER, fname, buf) > diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat64.c > b/sysdeps/unix/sysv/linux/alpha/fxstat64.c index > 286a2f0a6c..9d6b8eca32 100644 --- > a/sysdeps/unix/sysv/linux/alpha/fxstat64.c +++ > b/sysdeps/unix/sysv/linux/alpha/fxstat64.c @@ -42,6 +42,4 @@ > __fxstat64 (int vers, int fd, struct stat64 *buf) } > } > } > -hidden_def (__fxstat64) > strong_alias (__fxstat64, __fxstat); > -hidden_ver (__fxstat64, __fxstat) > diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c > b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c index > f10c1d31e8..997fb87ac6 100644 --- > a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c +++ > b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c @@ -29,8 +29,4 @@ > __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, > int flag) { return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, > flag); } > -libc_hidden_def (__fxstatat64) > -#if IS_IN(libc) > strong_alias (__fxstatat64, __fxstatat); > -hidden_ver (__fxstatat64, __fxstatat) > -#endif > diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat64.c > b/sysdeps/unix/sysv/linux/alpha/lxstat64.c index > 90dc0c7ce7..38f132f15e 100644 --- > a/sysdeps/unix/sysv/linux/alpha/lxstat64.c +++ > b/sysdeps/unix/sysv/linux/alpha/lxstat64.c @@ -44,6 +44,3 @@ > __lxstat64 (int vers, const char *name, struct stat64 *buf) } > } > weak_alias (__lxstat64, __lxstat); > -weak_alias (__lxstat64, __GI___lxstat); > - > -hidden_def (__lxstat64) > diff --git a/sysdeps/unix/sysv/linux/alpha/xstat64.c > b/sysdeps/unix/sysv/linux/alpha/xstat64.c index > ac1af53780..c856c95dc5 100644 --- > a/sysdeps/unix/sysv/linux/alpha/xstat64.c +++ > b/sysdeps/unix/sysv/linux/alpha/xstat64.c @@ -44,6 +44,3 @@ __xstat64 > (int vers, const char *name, struct stat64 *buf) } > } > weak_alias (__xstat64, __xstat); > -weak_alias (__xstat64, __GI___xstat); > - > -hidden_def (__xstat64) > diff --git a/sysdeps/unix/sysv/linux/fstatat.c > b/sysdeps/unix/sysv/linux/fstatat.c index 457496605c..03ddb3f493 > 100644 --- a/sysdeps/unix/sysv/linux/fstatat.c > +++ b/sysdeps/unix/sysv/linux/fstatat.c > @@ -18,12 +18,64 @@ > =20 > #include > #include > +#include > =20 > #if !XSTAT_IS_XSTAT64 > +# include > + > int > -__fstatat (int fd, const char *file, struct stat *buf, int flag) > +__fstatat (int fd, const char *file, struct stat *st, int flag) > { > - return __fxstatat (_STAT_VER, fd, file, buf, flag); > +# if STAT_IS_KERNEL_STAT > + /* New kABIs which uses generic pre 64-bit time Linux ABI, e.g. > + csky, nios2 */ > + int r =3D INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag); > + if (r =3D=3D 0 && (st->__st_ino_pad !=3D 0 > + || st->__st_size_pad !=3D 0 > + || st->__st_blocks_pad !=3D 0)) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); > + return r; > +# else > +# ifdef __NR_fstatat64 > + /* Old KABIs with old non-LFS support, e.g. arm, i386, hppa, m68k, > mips32, > + microblaze, s390, sh, powerpc, and sparc. */ > + struct stat64 st64; > + int r =3D INLINE_SYSCALL_CALL (fstatat64, fd, file, &st64, flag); > + if (r =3D=3D 0) > + { > + if (! in_ino_t_range (st64.st_ino) > + || ! in_off_t_range (st64.st_size) > + || ! in_blkcnt_t_range (st64.st_blocks)) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); > + > + /* Clear internal pad and reserved fields. */ > + memset (st, 0, sizeof (*st)); > + > + st->st_dev =3D st64.st_dev, > + st->st_ino =3D st64.st_ino; > + st->st_mode =3D st64.st_mode; > + st->st_nlink =3D st64.st_nlink; > + st->st_uid =3D st64.st_uid; > + st->st_gid =3D st64.st_gid; > + st->st_rdev =3D st64.st_rdev; > + st->st_size =3D st64.st_size; > + st->st_blksize =3D st64.st_blksize; > + st->st_blocks =3D st64.st_blocks; > + st->st_atim.tv_sec =3D st64.st_atim.tv_sec; > + st->st_atim.tv_nsec =3D st64.st_atim.tv_nsec; > + st->st_mtim.tv_sec =3D st64.st_mtim.tv_sec; > + st->st_mtim.tv_nsec =3D st64.st_mtim.tv_nsec; > + st->st_ctim.tv_sec =3D st64.st_ctim.tv_sec; > + st->st_ctim.tv_nsec =3D st64.st_ctim.tv_nsec; > + } > + return r; > +# else > + /* 64-bit kabi outlier, e.g. mips64 and mips64-n32. */ > + struct kernel_stat kst; > + int r =3D INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); > + return r ?: __cp_kstat_stat (&kst, st); > +# endif /* __nr_fstatat64 */ > +# endif /* STAT_IS_KERNEL_STAT */ > } > =20 > weak_alias (__fstatat, fstatat) > diff --git a/sysdeps/unix/sysv/linux/fstatat64.c > b/sysdeps/unix/sysv/linux/fstatat64.c index 46487919e6..82fab107a5 > 100644 --- a/sysdeps/unix/sysv/linux/fstatat64.c > +++ b/sysdeps/unix/sysv/linux/fstatat64.c > @@ -21,12 +21,53 @@ > #include > #undef __fstatat > #undef fstatat > +#include > + > #include > +#include > + > +#include > +#include > =20 > int > -__fstatat64 (int fd, const char *file, struct stat64 *buf, int flag) > +__fstatat64 (int fd, const char *file, struct stat64 *st, int flag) > { > - return __fxstatat64 (_STAT_VER, fd, file, buf, flag); > +#if XSTAT_IS_XSTAT64 > +# ifdef __NR_newfstatat > + /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and > + x86_64. */ > + return INLINE_SYSCALL_CALL (newfstatat, fd, file, st, flag); > +# elif defined __NR_fstatat64 > +# if STAT64_IS_KERNEL_STAT64 > + /* 64-bit kABI outlier, e.g. alpha. */ > + return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag); > +# else > + /* 64-bit kABI outlier, e.g. sparc64. */ > + struct kernel_stat64 kst64; > + int r =3D INLINE_SYSCALL_CALL (fstatat64, fd, file, &kst64, flag); > + return r ?: __cp_stat64_kstat64 (st, &kst64); > +# endif > +# else > + /* 32-bit kABI with default 64-bit time_t, e.g. arc, riscv32. */ > + struct statx tmp; > + int r =3D INLINE_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | > flag, > + STATX_BASIC_STATS, &tmp); > + if (r =3D=3D 0) > + __cp_stat64_statx (st, &tmp); > + return r; > +# endif > +#else > +# ifdef __NR_fstatat64 > + /* All kABIs with non-LFS support, e.g. arm, csky, i386, hppa, > m68k, > + microblaze, nios2, sh, powerpc32, and sparc32. */ > + return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag); > +# else > + /* 64-bit kabi outlier, e.g. mips64 and mips64-n32. */ > + struct kernel_stat kst; > + int r =3D INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); > + return r ?: __cp_kstat_stat64 (&kst, st); > +# endif > +#endif > } > hidden_def (__fstatat64) > weak_alias (__fstatat64, fstatat64) > diff --git a/sysdeps/unix/sysv/linux/fxstat.c > b/sysdeps/unix/sysv/linux/fxstat.c index b46e344d0e..f78497ea92 100644 > --- a/sysdeps/unix/sysv/linux/fxstat.c > +++ b/sysdeps/unix/sysv/linux/fxstat.c > @@ -57,5 +57,4 @@ __fxstat (int vers, int fd, struct stat *buf) > } > } > } > -hidden_def (__fxstat) > #endif /* XSTAT_IS_XSTAT64 */ > diff --git a/sysdeps/unix/sysv/linux/fxstat64.c > b/sysdeps/unix/sysv/linux/fxstat64.c index d3834f1ce2..6ae7babccc > 100644 --- a/sysdeps/unix/sysv/linux/fxstat64.c > +++ b/sysdeps/unix/sysv/linux/fxstat64.c > @@ -59,13 +59,10 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf) > versioned_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2); > strong_alias (___fxstat64, __old__fxstat64) > compat_symbol (libc, __old__fxstat64, __fxstat64, GLIBC_2_1); > -hidden_ver (___fxstat64, __fxstat64) > #else > strong_alias (___fxstat64, __fxstat64) > -hidden_def (__fxstat64) > #endif > =20 > #if XSTAT_IS_XSTAT64 > strong_alias (__fxstat64, __fxstat); > -hidden_ver (__fxstat64, __fxstat) > #endif > diff --git a/sysdeps/unix/sysv/linux/fxstatat.c > b/sysdeps/unix/sysv/linux/fxstatat.c index 0291a2c598..1a60fc10e3 > 100644 --- a/sysdeps/unix/sysv/linux/fxstatat.c > +++ b/sysdeps/unix/sysv/linux/fxstatat.c > @@ -46,6 +46,4 @@ __fxstatat (int vers, int fd, const char *file, > struct stat *st, int flag) return r ?: __xstat32_conv (vers, &st64, > st); #endif > } > -libc_hidden_def (__fxstatat) > - > #endif /* XSTAT_IS_XSTAT64 */ > diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c > b/sysdeps/unix/sysv/linux/fxstatat64.c index ac33ab4fc9..7fe034809c > 100644 --- a/sysdeps/unix/sysv/linux/fxstatat64.c > +++ b/sysdeps/unix/sysv/linux/fxstatat64.c > @@ -61,8 +61,6 @@ __fxstatat64 (int vers, int fd, const char *file, > struct stat64 *st, int flag) #endif > return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); > } > -libc_hidden_def (__fxstatat64) > -#if XSTAT_IS_XSTAT64 && IS_IN(libc) > +#if XSTAT_IS_XSTAT64 > strong_alias (__fxstatat64, __fxstatat); > -hidden_ver (__fxstatat64, __fxstatat) > #endif > diff --git a/sysdeps/unix/sysv/linux/kstat_cp.h > b/sysdeps/unix/sysv/linux/kstat_cp.h new file mode 100644 > index 0000000000..8fa43ed2e1 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/kstat_cp.h > @@ -0,0 +1,2 @@ > +/* Empty, it is overridden by an architecture which might require > copy to ro > + from a kernel_stat stat struct to glibc export stat{64}. */ > diff --git a/sysdeps/unix/sysv/linux/lxstat.c > b/sysdeps/unix/sysv/linux/lxstat.c index dc63d20061..156173a4e1 100644 > --- a/sysdeps/unix/sysv/linux/lxstat.c > +++ b/sysdeps/unix/sysv/linux/lxstat.c > @@ -58,5 +58,4 @@ __lxstat (int vers, const char *name, struct stat > *buf) } > } > } > -hidden_def (__lxstat) > #endif /* XSTAT_IS_XSTAT64 */ > diff --git a/sysdeps/unix/sysv/linux/lxstat64.c > b/sysdeps/unix/sysv/linux/lxstat64.c index 375013e9b1..29bd1cdf72 > 100644 --- a/sysdeps/unix/sysv/linux/lxstat64.c > +++ b/sysdeps/unix/sysv/linux/lxstat64.c > @@ -81,8 +81,6 @@ weak_alias (___lxstat64, __GI___lxstat); > versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2); > strong_alias (___lxstat64, __old__lxstat64) > compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1); > -hidden_ver (___lxstat64, __lxstat64) > #else > strong_alias (___lxstat64, __lxstat64); > -hidden_def (__lxstat64) > #endif > diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c > b/sysdeps/unix/sysv/linux/mips/fxstat.c index 16c3cefee2..4585c2362b > 100644 --- a/sysdeps/unix/sysv/linux/mips/fxstat.c > +++ b/sysdeps/unix/sysv/linux/mips/fxstat.c > @@ -39,4 +39,3 @@ __fxstat (int vers, int fd, struct stat *buf) > } > } > } > -hidden_def (__fxstat) > diff --git a/sysdeps/unix/sysv/linux/mips/lxstat.c > b/sysdeps/unix/sysv/linux/mips/lxstat.c index eb07549adf..62a3b15b32 > 100644 --- a/sysdeps/unix/sysv/linux/mips/lxstat.c > +++ b/sysdeps/unix/sysv/linux/mips/lxstat.c > @@ -39,4 +39,3 @@ __lxstat (int vers, const char *name, struct stat > *buf) } > } > } > -hidden_def (__lxstat) > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c > b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c index > 3fcdd9f1ee..e6c1cacd4b 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c +++ > b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c @@ -31,5 +31,3 @@ > __fxstat64 (int vers, int fd, struct stat64 *buf) return r ?: > __xstat64_conv (vers, &kbuf, buf);=20 > } > - > -hidden_def (__fxstat64) > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c > b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c index > 58410a1441..e384dbab8b 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c +++ > b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c @@ -30,4 +30,3 @@ > __fxstatat (int vers, int fd, const char *file, struct stat *st, int > flag) int r =3D INLINE_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); > return r ?: __xstat_conv (vers, &kst, st); } > -libc_hidden_def (__fxstatat) > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c > b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c index > e5416d8971..cfd172d301 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c +++ > b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c @@ -33,4 +33,3 @@ > __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, > int flag) } return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); > } > -libc_hidden_def (__fxstatat64) > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h > b/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h new file mode 100644 > index 0000000000..7f226416f9 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h > @@ -0,0 +1,80 @@ > +/* Struct stat/stat64 to stat/stat64 conversion for Linux. > + Copyright (C) 2020 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be > useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library. If not, see > + . */ > + > +#include > +#include > + > +static inline int > +__cp_kstat_stat (const struct kernel_stat *kst, struct stat *st) > +{ > + st->st_dev =3D kst->st_dev; > + memset (&st->st_pad1, 0, sizeof (st->st_pad1)); > + st->st_ino =3D kst->st_ino; > + if (st->st_ino !=3D kst->st_ino) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); > + st->st_mode =3D kst->st_mode; > + st->st_nlink =3D kst->st_nlink; > + st->st_uid =3D kst->st_uid; > + st->st_gid =3D kst->st_gid; > + st->st_rdev =3D kst->st_rdev; > + memset (&st->st_pad2, 0, sizeof (st->st_pad2)); > + st->st_size =3D kst->st_size; > + if (st->st_size !=3D kst->st_size) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); > + st->st_pad3 =3D 0; > + st->st_atim.tv_sec =3D kst->st_atime_sec; > + st->st_atim.tv_nsec =3D kst->st_atime_nsec; > + st->st_mtim.tv_sec =3D kst->st_mtime_sec; > + st->st_mtim.tv_nsec =3D kst->st_mtime_nsec; > + st->st_ctim.tv_sec =3D kst->st_ctime_sec; > + st->st_ctim.tv_nsec =3D kst->st_ctime_nsec; > + st->st_blksize =3D kst->st_blksize; > + st->st_blocks =3D kst->st_blocks; > + if (st->st_blocks !=3D kst->st_blocks) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); > + memset (&st->st_pad5, 0, sizeof (st->st_pad5)); > + > + return 0; > +} > + > +static inline int > +__cp_kstat_stat64 (const struct kernel_stat *kst, struct stat64 *st) > +{ > + st->st_dev =3D kst->st_dev; > + memset (&st->st_pad1, 0, sizeof (st->st_pad1)); > + st->st_ino =3D kst->st_ino; > + st->st_mode =3D kst->st_mode; > + st->st_nlink =3D kst->st_nlink; > + st->st_uid =3D kst->st_uid; > + st->st_gid =3D kst->st_gid; > + st->st_rdev =3D kst->st_rdev; > + memset (&st->st_pad2, 0, sizeof (st->st_pad2)); > + st->st_pad3 =3D 0; > + st->st_size =3D kst->st_size; > + st->st_blksize =3D kst->st_blksize; > + st->st_blocks =3D kst->st_blocks; > + st->st_atim.tv_sec =3D kst->st_atime_sec; > + st->st_atim.tv_nsec =3D kst->st_atime_nsec; > + st->st_mtim.tv_sec =3D kst->st_mtime_sec; > + st->st_mtim.tv_nsec =3D kst->st_mtime_nsec; > + st->st_ctim.tv_sec =3D kst->st_ctime_sec; > + st->st_ctim.tv_nsec =3D kst->st_ctime_nsec; > + memset (&st->st_pad4, 0, sizeof (st->st_pad4)); > + > + return 0; > +} > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c > b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c index > 28bac57e58..0f3934f8c8 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c +++ > b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c @@ -29,5 +29,3 @@ > __lxstat64 (int vers, const char *name, struct stat64 *buf) int r =3D > INLINE_SYSCALL_CALL (lstat, name, &kbuf); return r ?: __xstat64_conv > (vers, &kbuf, buf); } > - > -hidden_def (__lxstat64) > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c > b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c index > 99b03c7593..64d2952276 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c +++ > b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c @@ -30,5 +30,3 @@ > __xstat64 (int vers, const char *name, struct stat64 *buf) int r =3D > INLINE_SYSCALL_CALL (stat, name, &kbuf); return r ?: __xstat64_conv > (vers, &kbuf, buf); } > - > -hidden_def (__xstat64) > diff --git a/sysdeps/unix/sysv/linux/mips/xstat.c > b/sysdeps/unix/sysv/linux/mips/xstat.c index 835691cf89..d6ff5ccbe0 > 100644 --- a/sysdeps/unix/sysv/linux/mips/xstat.c > +++ b/sysdeps/unix/sysv/linux/mips/xstat.c > @@ -39,4 +39,3 @@ __xstat (int vers, const char *name, struct stat > *buf) } > } > } > -hidden_def (__xstat) > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h > b/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h new file mode > 100644 index 0000000000..0599b6a49e > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h > @@ -0,0 +1,46 @@ > +/* Struct kernel_stat64 to stat64. Linux/SPARC version. > + Copyright (C) 2020 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be > useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library. If not, see > + . */ > + > +#include > + > +static inline int > +__cp_stat64_kstat64 (struct stat64 *st64, const struct kernel_stat64 > *kst64) +{ > + st64->st_dev =3D kst64->st_dev; > + st64->__pad1 =3D 0; > + st64->st_ino =3D kst64->st_ino; > + st64->st_mode =3D kst64->st_mode; > + st64->st_nlink =3D kst64->st_nlink; > + st64->st_uid =3D kst64->st_uid; > + st64->st_gid =3D kst64->st_gid; > + st64->st_rdev =3D kst64->st_rdev; > + st64->__pad2 =3D 0; > + st64->st_size =3D kst64->st_size; > + st64->st_blksize =3D kst64->st_blksize; > + st64->st_blocks =3D kst64->st_blocks; > + st64->st_atim.tv_sec =3D kst64->st_atime_sec; > + st64->st_atim.tv_nsec =3D kst64->st_atime_nsec; > + st64->st_mtim.tv_sec =3D kst64->st_mtime_sec; > + st64->st_mtim.tv_nsec =3D kst64->st_mtime_nsec; > + st64->st_ctim.tv_sec =3D kst64->st_ctime_sec; > + st64->st_ctim.tv_nsec =3D kst64->st_ctime_nsec; > + st64->__glibc_reserved4 =3D 0; > + st64->__glibc_reserved5 =3D 0; > + > + return 0; > +} > diff --git a/sysdeps/unix/sysv/linux/xstat.c > b/sysdeps/unix/sysv/linux/xstat.c index 0ae52b1901..a971e8cf6a 100644 > --- a/sysdeps/unix/sysv/linux/xstat.c > +++ b/sysdeps/unix/sysv/linux/xstat.c > @@ -57,5 +57,4 @@ __xstat (int vers, const char *name, struct stat > *buf) } > } > } > -hidden_def (__xstat) > #endif /* XSTAT_IS_XSTAT64 */ > diff --git a/sysdeps/unix/sysv/linux/xstat64.c > b/sysdeps/unix/sysv/linux/xstat64.c index 4feb55f429..e3a42966f5 > 100644 --- a/sysdeps/unix/sysv/linux/xstat64.c > +++ b/sysdeps/unix/sysv/linux/xstat64.c > @@ -78,8 +78,6 @@ weak_alias (___xstat64, __GI___xstat); > versioned_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2); > strong_alias (___xstat64, __old__xstat64) > compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1); > -hidden_ver (___xstat64, __xstat64) > #else > strong_alias (___xstat64, __xstat64) > -hidden_def (__xstat64) > #endif Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/zttFzK7W.REMfNUqvnPNqw0 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl8arDsACgkQAR8vZIA0 zr3qqwgAwZqYgWYgaDp4lnJGk1SA9eyueuHdSLw1rfk8tTVjAUOif92N18Xge9Jx nPb26yjTylH5OZMxlxJh2B2s+n4qLG8JCKcQ9nwz/dgkkJI+uipE75HKAefBUElI /8iSg5hLdSEwyGY/qbGPinCYii4L0KvFp/V9Wr3kRQdbtY7qn365tBULQBSQBDSK j81SUVAW8ZeYa+/XhpAAOIvAxh1xJv+pCpa/2pnoATLsISc+Oj7gjf01gUzwRpbN JibrC8R6WmTk3aFls9vRUseajMJE8zSS6GKSL8Jm3kZtv8V1Qz5J6ih/179rTEJS lMJEcObLqE3ew0AE/UtpMVa5INio1w== =/Zqm -----END PGP SIGNATURE----- --Sig_/zttFzK7W.REMfNUqvnPNqw0--