From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: libc-alpha@sourceware.org
Cc: Alistair Francis <alistair.francis@wdc.com>
Subject: [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols
Date: Thu, 23 Jul 2020 16:46:39 -0300 [thread overview]
Message-ID: <20200723194641.1949404-15-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20200723194641.1949404-1-adhemerval.zanella@linaro.org>
They are not used internally anymore.
Checked with a build for all affected Linux ABIs. I checked also
on x86_64-linux-gnu and i686-linux-gnu.
---
sysdeps/unix/sysv/linux/alpha/fxstat64.c | 12 ++++++++++-
sysdeps/unix/sysv/linux/alpha/fxstatat64.c | 9 +++++++-
sysdeps/unix/sysv/linux/alpha/lxstat64.c | 12 ++++++++++-
sysdeps/unix/sysv/linux/alpha/xstat64.c | 12 ++++++++++-
sysdeps/unix/sysv/linux/fxstat.c | 8 +++++++
sysdeps/unix/sysv/linux/fxstat64.c | 14 +++++++++----
sysdeps/unix/sysv/linux/fxstatat.c | 8 +++++++
sysdeps/unix/sysv/linux/fxstatat64.c | 12 ++++++++++-
sysdeps/unix/sysv/linux/lxstat.c | 8 +++++++
sysdeps/unix/sysv/linux/lxstat64.c | 21 ++++++++++++-------
sysdeps/unix/sysv/linux/mips/fxstat.c | 8 +++++++
sysdeps/unix/sysv/linux/mips/lxstat.c | 8 +++++++
.../unix/sysv/linux/mips/mips64/fxstat64.c | 8 +++++++
.../unix/sysv/linux/mips/mips64/fxstatat.c | 8 +++++++
.../unix/sysv/linux/mips/mips64/fxstatat64.c | 8 +++++++
.../unix/sysv/linux/mips/mips64/lxstat64.c | 8 +++++++
sysdeps/unix/sysv/linux/mips/mips64/xstat64.c | 9 +++++++-
sysdeps/unix/sysv/linux/mips/xstat.c | 8 +++++++
sysdeps/unix/sysv/linux/xstat.c | 9 ++++++++
sysdeps/unix/sysv/linux/xstat64.c | 15 ++++++++-----
20 files changed, 182 insertions(+), 23 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat64.c b/sysdeps/unix/sysv/linux/alpha/fxstat64.c
index 9d6b8eca32..bcfb55050c 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstat64.c
@@ -22,9 +22,11 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__fxstat64 (int vers, int fd, struct stat64 *buf)
{
switch (vers)
@@ -42,4 +44,12 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
}
}
}
-strong_alias (__fxstat64, __fxstat);
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+strong_alias (__fxstat64, __fxstat_compat)
+compat_symbol (libc, __fxstat_compat, __fxstat, GLIBC_2_0);
+#endif
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+compat_symbol (libc, __fxstat64, __fxstat64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c
index 997fb87ac6..fa3074eeca 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c
@@ -22,11 +22,18 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
{
return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag);
}
-strong_alias (__fxstatat64, __fxstatat);
+strong_alias (__fxstatat64, __fxstatat_compat)
+compat_symbol (libc, __fxstatat_compat, __fxstatat, GLIBC_2_4);
+
+compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4);
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat64.c b/sysdeps/unix/sysv/linux/alpha/lxstat64.c
index 38f132f15e..7424b2f621 100644
--- a/sysdeps/unix/sysv/linux/alpha/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/lxstat64.c
@@ -23,9 +23,11 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__lxstat64 (int vers, const char *name, struct stat64 *buf)
{
switch (vers)
@@ -43,4 +45,12 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
}
}
}
-weak_alias (__lxstat64, __lxstat);
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+strong_alias (__lxstat64, __lxstat_compat)
+compat_symbol (libc, __lxstat_compat, __lxstat, GLIBC_2_0);
+#endif
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+compat_symbol (libc, __lxstat64, __lxstat64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/xstat64.c b/sysdeps/unix/sysv/linux/alpha/xstat64.c
index c856c95dc5..59f7ddae7f 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstat64.c
@@ -23,9 +23,11 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__xstat64 (int vers, const char *name, struct stat64 *buf)
{
switch (vers)
@@ -43,4 +45,12 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
}
}
}
-weak_alias (__xstat64, __xstat);
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+strong_alias (__xstat64, __xstat_compat)
+compat_symbol (libc, __xstat_compat, __xstat, GLIBC_2_0);
+#endif
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+compat_symbol (libc, __xstat64, __xstat64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index f78497ea92..649bb95252 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -24,9 +24,13 @@
#if !XSTAT_IS_XSTAT64
# include <xstatconv.h>
# include <xstatover.h>
+# include <shlib-compat.h>
+
+# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
/* Get information about the file FD in BUF. */
int
+attribute_compat_text_section
__fxstat (int vers, int fd, struct stat *buf)
{
switch (vers)
@@ -57,4 +61,8 @@ __fxstat (int vers, int fd, struct stat *buf)
}
}
}
+
+compat_symbol (libc, __fxstat, __fxstat, GLIBC_2_0);
+# endif /* SHLIB_COMPAT */
+
#endif /* XSTAT_IS_XSTAT64 */
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index 6ae7babccc..726dfd0ad6 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -24,10 +24,14 @@
#include <sysdep.h>
#include <xstatconv.h>
#include <statx_cp.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
/* Get information about the file FD in BUF. */
int
+attribute_compat_text_section
___fxstat64 (int vers, int fd, struct stat64 *buf)
{
#if XSTAT_IS_XSTAT64
@@ -53,16 +57,18 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf)
#endif /* XSTAT_IS_XSTAT64 */
}
-#include <shlib-compat.h>
-
#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-versioned_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2);
+compat_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2);
strong_alias (___fxstat64, __old__fxstat64)
compat_symbol (libc, __old__fxstat64, __fxstat64, GLIBC_2_1);
#else
strong_alias (___fxstat64, __fxstat64)
+compat_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2);
#endif
#if XSTAT_IS_XSTAT64
-strong_alias (__fxstat64, __fxstat);
+strong_alias (___fxstat64, __fxstat_compat)
+compat_symbol (libc, __fxstat_compat, __fxstat, GLIBC_2_2);
#endif
+
+#endif /* SHLIB_COMPAT */
diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c
index 1a60fc10e3..2083e18eac 100644
--- a/sysdeps/unix/sysv/linux/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/fxstatat.c
@@ -24,9 +24,13 @@
#if !XSTAT_IS_XSTAT64
# include <xstatconv.h>
# include <xstatover.h>
+# include <shlib-compat.h>
+
+# if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
/* Get information about the file FD in BUF. */
int
+attribute_compat_text_section
__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
{
#if STAT_IS_KERNEL_STAT
@@ -46,4 +50,8 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
return r ?: __xstat32_conv (vers, &st64, st);
#endif
}
+
+compat_symbol (libc, __fxstatat, __fxstatat, GLIBC_2_4);
+# endif /* SHLIB_COMPAT */
+
#endif /* XSTAT_IS_XSTAT64 */
diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c
index 7fe034809c..8a505451d9 100644
--- a/sysdeps/unix/sysv/linux/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/fxstatat64.c
@@ -24,10 +24,14 @@
#include <sysdep.h>
#include <xstatconv.h>
#include <statx_cp.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
/* Get information about the file FD in BUF. */
int
+attribute_compat_text_section
__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
{
#if XSTAT_IS_XSTAT64
@@ -61,6 +65,12 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
#endif
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
}
+
+compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4);
+
#if XSTAT_IS_XSTAT64
-strong_alias (__fxstatat64, __fxstatat);
+strong_alias (__fxstatat64, __fxstatat_compat)
+compat_symbol (libc, __fxstatat_compat, __fxstatat, GLIBC_2_4);
#endif
+
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33) */
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index 156173a4e1..f307aa4942 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -20,13 +20,17 @@
#include <fcntl.h>
#include <kernel_stat.h>
#include <sysdep.h>
+#include <shlib-compat.h>
#if !XSTAT_IS_XSTAT64
# include <xstatconv.h>
# include <xstatover.h>
+# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__lxstat (int vers, const char *name, struct stat *buf)
{
switch (vers)
@@ -58,4 +62,8 @@ __lxstat (int vers, const char *name, struct stat *buf)
}
}
}
+
+compat_symbol (libc, __lxstat, __lxstat, GLIBC_2_0);
+# endif /* SHLIB_COMPAT */
+
#endif /* XSTAT_IS_XSTAT64 */
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
index 29bd1cdf72..660d59aea3 100644
--- a/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/lxstat64.c
@@ -24,10 +24,14 @@
#include <sysdep.h>
#include <xstatconv.h>
#include <statx_cp.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
___lxstat64 (int vers, const char *name, struct stat64 *buf)
{
#if XSTAT_IS_XSTAT64
@@ -70,17 +74,18 @@ ___lxstat64 (int vers, const char *name, struct stat64 *buf)
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
}
-#if XSTAT_IS_XSTAT64
-weak_alias (___lxstat64, __lxstat);
-weak_alias (___lxstat64, __GI___lxstat);
-#endif
-
-#include <shlib-compat.h>
-
#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2);
+compat_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2);
strong_alias (___lxstat64, __old__lxstat64)
compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1);
#else
strong_alias (___lxstat64, __lxstat64);
+compat_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2);
#endif
+
+#if XSTAT_IS_XSTAT64
+strong_alias (___lxstat64,__lxstat_compat)
+compat_symbol (libc, __lxstat_compat, __lxstat, GLIBC_2_2);
+#endif
+
+#endif /* SHLIB_COMPAT */
diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c b/sysdeps/unix/sysv/linux/mips/fxstat.c
index 4585c2362b..cb9f656628 100644
--- a/sysdeps/unix/sysv/linux/mips/fxstat.c
+++ b/sysdeps/unix/sysv/linux/mips/fxstat.c
@@ -21,9 +21,13 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__fxstat (int vers, int fd, struct stat *buf)
{
switch (vers)
@@ -39,3 +43,7 @@ __fxstat (int vers, int fd, struct stat *buf)
}
}
}
+
+compat_symbol (libc, __fxstat, __fxstat, GLIBC_2_0);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/lxstat.c b/sysdeps/unix/sysv/linux/mips/lxstat.c
index 62a3b15b32..ebd05cca50 100644
--- a/sysdeps/unix/sysv/linux/mips/lxstat.c
+++ b/sysdeps/unix/sysv/linux/mips/lxstat.c
@@ -21,9 +21,13 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__lxstat (int vers, const char *name, struct stat *buf)
{
switch (vers)
@@ -39,3 +43,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
}
}
}
+
+compat_symbol (libc, __lxstat, __lxstat, GLIBC_2_0);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index e6c1cacd4b..855c650814 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -20,10 +20,14 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_33)
/* Get information about the file FD in BUF. */
int
+attribute_compat_text_section
__fxstat64 (int vers, int fd, struct stat64 *buf)
{
struct kernel_stat kbuf;
@@ -31,3 +35,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
return r ?: __xstat64_conv (vers, &kbuf, buf);
}
+
+compat_symbol (libc, __fxstat64, __fxstat64, GLIBC_2_2);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
index e384dbab8b..1c1fbb02c2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
@@ -21,12 +21,20 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
/* Get information about the file FD in BUF. */
int
+attribute_compat_text_section
__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
{
struct kernel_stat kst;
int r = INLINE_SYSCALL_CALL (newfstatat, fd, file, &kst, flag);
return r ?: __xstat_conv (vers, &kst, st);
}
+
+compat_symbol (libc, __fxstatat, __fxstatat, GLIBC_2_4);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index cfd172d301..f40a2c5aa8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
@@ -19,10 +19,14 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
{
if (vers == _STAT_VER_LINUX)
@@ -33,3 +37,7 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
}
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
}
+
+compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 0f3934f8c8..752c5284a7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -20,12 +20,20 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__lxstat64 (int vers, const char *name, struct stat64 *buf)
{
struct kernel_stat kbuf;
int r = INLINE_SYSCALL_CALL (lstat, name, &kbuf);
return r ?: __xstat64_conv (vers, &kbuf, buf);
}
+
+compat_symbol (libc, __lxstat64, __lxstat64, GLIBC_2_2);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index 64d2952276..a620ba2f1f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -20,13 +20,20 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
-/* Get information about the file NAME in BUF. */
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_33)
+/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__xstat64 (int vers, const char *name, struct stat64 *buf)
{
struct kernel_stat kbuf;
int r = INLINE_SYSCALL_CALL (stat, name, &kbuf);
return r ?: __xstat64_conv (vers, &kbuf, buf);
}
+
+compat_symbol (libc, __xstat64, __xstat64, GLIBC_2_2);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/xstat.c b/sysdeps/unix/sysv/linux/mips/xstat.c
index d6ff5ccbe0..0748a3422d 100644
--- a/sysdeps/unix/sysv/linux/mips/xstat.c
+++ b/sysdeps/unix/sysv/linux/mips/xstat.c
@@ -21,9 +21,13 @@
#include <kernel_stat.h>
#include <sysdep.h>
#include <xstatconv.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__xstat (int vers, const char *name, struct stat *buf)
{
switch (vers)
@@ -39,3 +43,7 @@ __xstat (int vers, const char *name, struct stat *buf)
}
}
}
+
+compat_symbol (libc, __xstat, __xstat, GLIBC_2_0);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index a971e8cf6a..51329831b0 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -20,13 +20,17 @@
#include <fcntl.h>
#include <kernel_stat.h>
#include <sysdep.h>
+#include <shlib-compat.h>
#if !XSTAT_IS_XSTAT64
# include <xstatconv.h>
# include <xstatover.h>
+# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
__xstat (int vers, const char *name, struct stat *buf)
{
switch (vers)
@@ -57,4 +61,9 @@ __xstat (int vers, const char *name, struct stat *buf)
}
}
}
+
+compat_symbol (libc, __xstat, __xstat, GLIBC_2_0);
+# endif /* SHLIB_COMPAT */
+
#endif /* XSTAT_IS_XSTAT64 */
+
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
index e3a42966f5..4872d24694 100644
--- a/sysdeps/unix/sysv/linux/xstat64.c
+++ b/sysdeps/unix/sysv/linux/xstat64.c
@@ -24,10 +24,14 @@
#include <sysdep.h>
#include <xstatconv.h>
#include <statx_cp.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
/* Get information about the file NAME in BUF. */
int
+attribute_compat_text_section
___xstat64 (int vers, const char *name, struct stat64 *buf)
{
#if XSTAT_IS_XSTAT64
@@ -68,16 +72,17 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf)
}
#if XSTAT_IS_XSTAT64
-weak_alias (___xstat64, __xstat);
-weak_alias (___xstat64, __GI___xstat);
+strong_alias (___xstat64, __xstat_compat)
+compat_symbol (libc, __xstat_compat, __xstat, GLIBC_2_2);
#endif
-#include <shlib-compat.h>
-
#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-versioned_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2);
+compat_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2);
strong_alias (___xstat64, __old__xstat64)
compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1);
#else
strong_alias (___xstat64, __xstat64)
+compat_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2);
#endif
+
+#endif /* SHLIB_COMPAT */
--
2.25.1
next prev parent reply other threads:[~2020-07-23 19:48 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-23 19:46 [PATCH 00/16] Add y2038 support for stat functions Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 01/16] linux: Always define STAT_IS_KERNEL_STAT Adhemerval Zanella via Libc-alpha
2020-07-24 8:17 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 02/16] linux: Define STAT64_IS_KERNEL_STAT64 Adhemerval Zanella via Libc-alpha
2020-07-24 8:20 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 03/16] linux: Consolidate xstat{64} Adhemerval Zanella via Libc-alpha
2020-07-23 20:51 ` Joseph Myers
2020-07-24 8:34 ` Lukasz Majewski
2020-09-09 14:46 ` Lukasz Majewski
2020-09-09 18:05 ` Adhemerval Zanella via Libc-alpha
2020-09-10 7:10 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 04/16] linux: Consolidate lxstat{64} Adhemerval Zanella via Libc-alpha
2020-07-24 8:43 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 05/16] linux: Consolidate fxstat{64} Adhemerval Zanella via Libc-alpha
2020-07-24 9:04 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 06/16] linux: Consolidate fxstatat{64} Adhemerval Zanella via Libc-alpha
2020-07-24 9:14 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 07/16] Linux: Consolidate xmknod Adhemerval Zanella via Libc-alpha
2020-07-24 9:14 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 08/16] Remove internal usage of extensible stat functions Adhemerval Zanella via Libc-alpha
2020-07-24 9:16 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 09/16] Remove stat wrapper functions, move them to exported symbols Adhemerval Zanella via Libc-alpha
2020-07-24 9:23 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 10/16] Remove mknod wrapper functions, move them to symbols Adhemerval Zanella via Libc-alpha
2020-07-23 20:53 ` Joseph Myers
2020-07-23 20:58 ` Adhemerval Zanella via Libc-alpha
2020-07-23 21:01 ` Joseph Myers
2020-07-24 9:25 ` Lukasz Majewski
2020-10-12 22:27 ` Joseph Myers
2020-10-13 0:58 ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 11/16] linux: Move the struct stat{64} to struct_stat.h Adhemerval Zanella via Libc-alpha
2020-07-24 9:27 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 12/16] linux: Implement {l}fstat{at} in terms of fstatat Adhemerval Zanella via Libc-alpha
2020-07-24 9:29 ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 13/16] linux: Disentangle fstatat from fxstatat Adhemerval Zanella via Libc-alpha
2020-07-24 9:39 ` Lukasz Majewski
2020-07-24 10:25 ` Florian Weimer via Libc-alpha
2020-07-24 14:39 ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` Adhemerval Zanella via Libc-alpha [this message]
2020-07-24 9:40 ` [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols Lukasz Majewski
2020-10-21 5:21 ` __xstat et al. as compat symbols (was: Re: [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols) Florian Weimer via Libc-alpha
2020-10-21 11:59 ` Adhemerval Zanella via Libc-alpha
2020-10-21 12:57 ` __xstat et al. as compat symbols Florian Weimer via Libc-alpha
2020-10-21 13:09 ` Adhemerval Zanella via Libc-alpha
2020-10-22 10:08 ` Florian Weimer via Libc-alpha
2020-10-22 12:43 ` Adhemerval Zanella via Libc-alpha
2020-10-22 15:37 ` Florian Weimer via Libc-alpha
2020-10-22 16:40 ` Adhemerval Zanella via Libc-alpha
2020-10-22 18:04 ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 15/16] linux: Add {f}stat{at} y2038 support Adhemerval Zanella via Libc-alpha
2020-07-23 20:55 ` Joseph Myers
2020-07-23 21:00 ` Adhemerval Zanella via Libc-alpha
2020-07-24 10:53 ` Lukasz Majewski
2020-07-30 12:42 ` Adhemerval Zanella via Libc-alpha
2020-08-02 19:46 ` Maciej W. Rozycki via Libc-alpha
2020-10-06 9:48 ` Lukasz Majewski
2020-10-07 12:52 ` Adhemerval Zanella via Libc-alpha
2020-10-07 14:25 ` Adhemerval Zanella via Libc-alpha
2020-10-07 20:20 ` Lukasz Majewski
2020-10-07 21:01 ` Adhemerval Zanella via Libc-alpha
2020-10-07 21:07 ` Adhemerval Zanella via Libc-alpha
2020-10-08 7:57 ` Lukasz Majewski
2020-10-09 14:05 ` Adhemerval Zanella via Libc-alpha
2020-10-09 15:39 ` Lukasz Majewski
2020-10-09 20:06 ` Adhemerval Zanella via Libc-alpha
2020-10-13 13:58 ` Lukasz Majewski
2020-10-13 14:18 ` Adhemerval Zanella via Libc-alpha
2020-10-13 14:23 ` H.J. Lu via Libc-alpha
2020-10-13 14:27 ` Adhemerval Zanella via Libc-alpha
2020-10-13 18:14 ` Adhemerval Zanella via Libc-alpha
2020-10-13 21:20 ` Lukasz Majewski
2020-10-13 21:40 ` Lukasz Majewski
2020-10-14 13:15 ` Lukasz Majewski
2020-10-14 13:39 ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 16/16] linux: Move xmknoda{at} to compat symbols Adhemerval Zanella via Libc-alpha
2020-07-24 10:30 ` Florian Weimer via Libc-alpha
2020-07-24 12:34 ` Adhemerval Zanella via Libc-alpha
2020-07-24 12:43 ` Florian Weimer via Libc-alpha
2020-07-24 12:49 ` Adhemerval Zanella via Libc-alpha
2020-07-24 10:43 ` Lukasz Majewski
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200723194641.1949404-15-adhemerval.zanella@linaro.org \
--to=libc-alpha@sourceware.org \
--cc=adhemerval.zanella@linaro.org \
--cc=alistair.francis@wdc.com \
/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).