From: Adhemerval Zanella Date: Wed, 2 Dec 2020 16:51:57 +0000 (-0300) Subject: Revert "linux: Move {f}xstat{at} to compat symbols" X-Git-Tag: glibc-2.33~249 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22edf4d4b2fe9bfb4bd7376467d0958e22b04f23;p=thirdparty%2Fglibc.git Revert "linux: Move {f}xstat{at} to compat symbols" This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to move {f}xstat{at} back to default symbols. ABIs with default symbol version of 2.33 or newer (such as riscv32) continue to just provide the stat symbols. The idea is to not force static libraries built against old glibc to update against new glibcs (since they reference the old {f}xstat{at} symbols). Checked on x86_64-linux-gnu and i686-linux-gnu. --- diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat64.c b/sysdeps/unix/sysv/linux/alpha/fxstat64.c index bcfb55050c2..9d6b8eca32a 100644 --- a/sysdeps/unix/sysv/linux/alpha/fxstat64.c +++ b/sysdeps/unix/sysv/linux/alpha/fxstat64.c @@ -22,11 +22,9 @@ #include #include #include -#include /* Get information about the file NAME in BUF. */ int -attribute_compat_text_section __fxstat64 (int vers, int fd, struct stat64 *buf) { switch (vers) @@ -44,12 +42,4 @@ __fxstat64 (int vers, int fd, struct stat64 *buf) } } } - -#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 +strong_alias (__fxstat64, __fxstat); diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c index fa3074eecae..997fb87ac66 100644 --- a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c @@ -22,18 +22,11 @@ #include #include #include -#include -#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_compat) -compat_symbol (libc, __fxstatat_compat, __fxstatat, GLIBC_2_4); - -compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4); -#endif +strong_alias (__fxstatat64, __fxstatat); diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat64.c b/sysdeps/unix/sysv/linux/alpha/lxstat64.c index 7424b2f621a..38f132f15ec 100644 --- a/sysdeps/unix/sysv/linux/alpha/lxstat64.c +++ b/sysdeps/unix/sysv/linux/alpha/lxstat64.c @@ -23,11 +23,9 @@ #include #include #include -#include /* Get information about the file NAME in BUF. */ int -attribute_compat_text_section __lxstat64 (int vers, const char *name, struct stat64 *buf) { switch (vers) @@ -45,12 +43,4 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf) } } } - -#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 +weak_alias (__lxstat64, __lxstat); diff --git a/sysdeps/unix/sysv/linux/alpha/xstat64.c b/sysdeps/unix/sysv/linux/alpha/xstat64.c index 59f7ddae7f1..c856c95dc5b 100644 --- a/sysdeps/unix/sysv/linux/alpha/xstat64.c +++ b/sysdeps/unix/sysv/linux/alpha/xstat64.c @@ -23,11 +23,9 @@ #include #include #include -#include /* Get information about the file NAME in BUF. */ int -attribute_compat_text_section __xstat64 (int vers, const char *name, struct stat64 *buf) { switch (vers) @@ -45,12 +43,4 @@ __xstat64 (int vers, const char *name, struct stat64 *buf) } } } - -#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 +weak_alias (__xstat64, __xstat); diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c index 649bb952520..528eedc2726 100644 --- a/sysdeps/unix/sysv/linux/fxstat.c +++ b/sysdeps/unix/sysv/linux/fxstat.c @@ -30,7 +30,6 @@ /* Get information about the file FD in BUF. */ int -attribute_compat_text_section __fxstat (int vers, int fd, struct stat *buf) { switch (vers) @@ -62,7 +61,6 @@ __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 4bd926bf01b..9471d0be459 100644 --- a/sysdeps/unix/sysv/linux/fxstat64.c +++ b/sysdeps/unix/sysv/linux/fxstat64.c @@ -31,7 +31,6 @@ /* 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 @@ -68,17 +67,15 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf) } #if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) -compat_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2); +versioned_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_compat) -compat_symbol (libc, __fxstat_compat, __fxstat, GLIBC_2_2); +strong_alias (___fxstat64, __fxstat) #endif #endif /* SHLIB_COMPAT */ diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c index 2083e18eac0..bd78971dea2 100644 --- a/sysdeps/unix/sysv/linux/fxstatat.c +++ b/sysdeps/unix/sysv/linux/fxstatat.c @@ -30,7 +30,6 @@ /* 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 @@ -51,7 +50,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) #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 8a505451d98..091da83f1f8 100644 --- a/sysdeps/unix/sysv/linux/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/fxstatat64.c @@ -31,7 +31,6 @@ /* 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 @@ -66,11 +65,8 @@ __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); - #if XSTAT_IS_XSTAT64 -strong_alias (__fxstatat64, __fxstatat_compat) -compat_symbol (libc, __fxstatat_compat, __fxstatat, GLIBC_2_4); +strong_alias (__fxstatat64, __fxstatat) #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 913618eab95..c7d4507d7c3 100644 --- a/sysdeps/unix/sysv/linux/lxstat.c +++ b/sysdeps/unix/sysv/linux/lxstat.c @@ -30,7 +30,6 @@ /* Get information about the file NAME in BUF. */ int -attribute_compat_text_section __lxstat (int vers, const char *name, struct stat *buf) { switch (vers) @@ -63,7 +62,6 @@ __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 277b54b305b..74e11f3467f 100644 --- a/sysdeps/unix/sysv/linux/lxstat64.c +++ b/sysdeps/unix/sysv/linux/lxstat64.c @@ -31,7 +31,6 @@ /* 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 @@ -85,17 +84,15 @@ ___lxstat64 (int vers, const char *name, struct stat64 *buf) } #if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) -compat_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2); +versioned_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); +strong_alias (___lxstat64,__lxstat) #endif #endif /* SHLIB_COMPAT */ diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c b/sysdeps/unix/sysv/linux/mips/fxstat.c index cb9f6566289..4585c2362bb 100644 --- a/sysdeps/unix/sysv/linux/mips/fxstat.c +++ b/sysdeps/unix/sysv/linux/mips/fxstat.c @@ -21,13 +21,9 @@ #include #include #include -#include - -#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) @@ -43,7 +39,3 @@ __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 ebd05cca509..62a3b15b32e 100644 --- a/sysdeps/unix/sysv/linux/mips/lxstat.c +++ b/sysdeps/unix/sysv/linux/mips/lxstat.c @@ -21,13 +21,9 @@ #include #include #include -#include - -#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) @@ -43,7 +39,3 @@ __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 855c650814c..e6c1cacd4b7 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c +++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c @@ -20,14 +20,10 @@ #include #include #include -#include - -#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; @@ -35,7 +31,3 @@ __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 1c1fbb02c29..e384dbab8b6 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c +++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c @@ -21,20 +21,12 @@ #include #include #include -#include - -#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 f40a2c5aa8a..cfd172d3018 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c @@ -19,14 +19,10 @@ #include #include #include -#include - -#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) @@ -37,7 +33,3 @@ __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 752c5284a71..0f3934f8c8b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c +++ b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c @@ -20,20 +20,12 @@ #include #include #include -#include - -#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 a620ba2f1f2..699df60740f 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c +++ b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c @@ -20,20 +20,12 @@ #include #include #include -#include - -#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 0748a3422df..d6ff5ccbe06 100644 --- a/sysdeps/unix/sysv/linux/mips/xstat.c +++ b/sysdeps/unix/sysv/linux/mips/xstat.c @@ -21,13 +21,9 @@ #include #include #include -#include - -#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) @@ -43,7 +39,3 @@ __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 3eb2d8c51b4..87556af616f 100644 --- a/sysdeps/unix/sysv/linux/xstat.c +++ b/sysdeps/unix/sysv/linux/xstat.c @@ -30,7 +30,6 @@ /* Get information about the file NAME in BUF. */ int -attribute_compat_text_section __xstat (int vers, const char *name, struct stat *buf) { switch (vers) @@ -62,7 +61,6 @@ __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 dd4f808c7ab..ec912fd2b9c 100644 --- a/sysdeps/unix/sysv/linux/xstat64.c +++ b/sysdeps/unix/sysv/linux/xstat64.c @@ -31,7 +31,6 @@ /* 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 @@ -82,17 +81,15 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf) } #if XSTAT_IS_XSTAT64 -strong_alias (___xstat64, __xstat_compat) -compat_symbol (libc, __xstat_compat, __xstat, GLIBC_2_2); +strong_alias (___xstat64, __xstat) #endif #if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) -compat_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2); +versioned_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 */