[15/30] nptl: Remove pread from libpthread

Message ID 20210316200510.2135405-16-adhemerval.zanella@linaro.org
State New
Headers show
Series
  • libpthread removal: pthread-compat-wrappers and other libc symbols
Related show

Commit Message

Zack Weinberg via Libc-alpha March 16, 2021, 8:04 p.m.
The libc version is identical and built with same flags.  Alpha is the
only outlier: although it only supports LFS interfaces it provides
compat symbols for pread as well.  This is accomplished by
a new flag, PREAD64_REQUIRE_PREAD_COMPAT, which prevents the Linux
generic implementation to create the exported alias, and the
libpthread compat logic is added on arch-specific implementation.

Checked on x86_64-linux-gnu.
---
 include/unistd.h                              |  2 +-
 nptl/Makefile                                 |  4 +--
 nptl/Versions                                 |  3 --
 .../sysv/linux/aarch64/libpthread.abilist     |  3 --
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  3 ++
 .../unix/sysv/linux/alpha/libpthread.abilist  |  3 --
 sysdeps/unix/sysv/linux/alpha/pread64.c       | 33 +++++++++++++++++++
 .../unix/sysv/linux/arc/libpthread.abilist    |  3 --
 .../unix/sysv/linux/arm/be/libpthread.abilist |  3 --
 .../unix/sysv/linux/arm/le/libpthread.abilist |  3 --
 .../unix/sysv/linux/csky/libpthread.abilist   |  3 --
 .../unix/sysv/linux/hppa/libpthread.abilist   |  3 --
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  3 ++
 .../unix/sysv/linux/i386/libpthread.abilist   |  3 --
 .../unix/sysv/linux/ia64/libpthread.abilist   |  3 --
 .../linux/m68k/coldfire/libpthread.abilist    |  3 --
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  3 ++
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  3 --
 .../linux/microblaze/be/libpthread.abilist    |  3 --
 .../linux/microblaze/le/libpthread.abilist    |  3 --
 .../sysv/linux/mips/mips32/libpthread.abilist |  3 --
 .../sysv/linux/mips/mips64/libpthread.abilist |  3 --
 .../unix/sysv/linux/nios2/libpthread.abilist  |  3 --
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  3 ++
 .../powerpc/powerpc32/libpthread.abilist      |  3 --
 .../powerpc/powerpc32/nofpu/libc.abilist      |  3 ++
 .../powerpc/powerpc64/be/libpthread.abilist   |  3 --
 .../powerpc/powerpc64/le/libpthread.abilist   |  3 --
 sysdeps/unix/sysv/linux/pread.c               | 13 ++++++++
 sysdeps/unix/sysv/linux/pread64.c             | 28 +++++++++++++---
 .../sysv/linux/riscv/rv32/libpthread.abilist  |  3 --
 .../sysv/linux/riscv/rv64/libpthread.abilist  |  3 --
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  3 ++
 .../linux/s390/s390-32/libpthread.abilist     |  3 --
 .../linux/s390/s390-64/libpthread.abilist     |  3 --
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  3 --
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  3 --
 .../sysv/linux/sparc/sparc32/libc.abilist     |  3 ++
 .../linux/sparc/sparc32/libpthread.abilist    |  3 --
 .../linux/sparc/sparc64/libpthread.abilist    |  3 --
 .../sysv/linux/x86_64/64/libpthread.abilist   |  3 --
 .../sysv/linux/x86_64/x32/libpthread.abilist  |  3 --
 42 files changed, 93 insertions(+), 98 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/alpha/pread64.c

-- 
2.25.1

Comments

Zack Weinberg via Libc-alpha March 17, 2021, 7:33 p.m. | #1
* Adhemerval Zanella via Libc-alpha:

> diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c

> new file mode 100644

> index 0000000000..a40e4447e1

> --- /dev/null

> +++ b/sysdeps/unix/sysv/linux/alpha/pread64.c

> @@ -0,0 +1,33 @@

> +/* Read from to a file descriptor at a given offset.  Linux/alpha version.

> +   Copyright (C) 2021 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

> +   <https://www.gnu.org/licenses/>.  */

> +

> +#define PREAD64_REQUIRE_PREAD_COMPAT

> +#include <sysdeps/unix/sysv/linux/pread64.c>

> +

> +/* libpthread compat symbols.  */

> +# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)

> +strong_alias (__libc_pread64, __compat_pread)

> +compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);

> +

> +strong_alias (__libc_pread64, __default_pread)

> +versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);

> +

> +/* It is a libc_hidden_def (__pread), but with a redirection due the symbol

> +   versioning.  */

> +__hidden_ver1 (__compat_pread, __GI___pread, __compat_pread);

> +#endif


I believe this is libc_hidden_ver.  It took me a while to find it (see
the original dance around ___libc_once).

This applies else where in this patch and also the pwrite patch.

Thanks,
Florian
Zack Weinberg via Libc-alpha March 17, 2021, 7:35 p.m. | #2
On 17/03/2021 16:33, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:

> 

>> diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c

>> new file mode 100644

>> index 0000000000..a40e4447e1

>> --- /dev/null

>> +++ b/sysdeps/unix/sysv/linux/alpha/pread64.c

>> @@ -0,0 +1,33 @@

>> +/* Read from to a file descriptor at a given offset.  Linux/alpha version.

>> +   Copyright (C) 2021 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

>> +   <https://www.gnu.org/licenses/>.  */

>> +

>> +#define PREAD64_REQUIRE_PREAD_COMPAT

>> +#include <sysdeps/unix/sysv/linux/pread64.c>

>> +

>> +/* libpthread compat symbols.  */

>> +# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)

>> +strong_alias (__libc_pread64, __compat_pread)

>> +compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);

>> +

>> +strong_alias (__libc_pread64, __default_pread)

>> +versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);

>> +

>> +/* It is a libc_hidden_def (__pread), but with a redirection due the symbol

>> +   versioning.  */

>> +__hidden_ver1 (__compat_pread, __GI___pread, __compat_pread);

>> +#endif

> 

> I believe this is libc_hidden_ver.  It took me a while to find it (see

> the original dance around ___libc_once).

> 

> This applies else where in this patch and also the pwrite patch.


Yes and I simplified the versioned and compat definitions a bit with
newer macros.
Zack Weinberg via Libc-alpha March 17, 2021, 7:41 p.m. | #3
* Florian Weimer:

> * Adhemerval Zanella via Libc-alpha:

>

>> diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c

>> new file mode 100644

>> index 0000000000..a40e4447e1

>> --- /dev/null

>> +++ b/sysdeps/unix/sysv/linux/alpha/pread64.c

>> @@ -0,0 +1,33 @@

>> +/* Read from to a file descriptor at a given offset.  Linux/alpha version.

>> +   Copyright (C) 2021 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

>> +   <https://www.gnu.org/licenses/>.  */

>> +

>> +#define PREAD64_REQUIRE_PREAD_COMPAT

>> +#include <sysdeps/unix/sysv/linux/pread64.c>

>> +

>> +/* libpthread compat symbols.  */

>> +# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)

>> +strong_alias (__libc_pread64, __compat_pread)

>> +compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);

>> +

>> +strong_alias (__libc_pread64, __default_pread)

>> +versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);

>> +

>> +/* It is a libc_hidden_def (__pread), but with a redirection due the symbol

>> +   versioning.  */

>> +__hidden_ver1 (__compat_pread, __GI___pread, __compat_pread);

>> +#endif

>

> I believe this is libc_hidden_ver.  It took me a while to find it (see

> the original dance around ___libc_once).

>

> This applies else where in this patch and also the pwrite patch.


Sorry, two more things: I don't quite see how alpha is an outlier here.

And ideally, this should receive the same treatment (and similar commit
message) as lseek64 because I think we should switch from GLIBC_2.2
symbols to GLIBC_2.1 for the default, and make the GLIBC_2.2 symbols
compat versions.

Both comments apply to the pwrite change as well.

Thanks,
Florian
Zack Weinberg via Libc-alpha March 17, 2021, 7:47 p.m. | #4
On 17/03/2021 16:41, Florian Weimer wrote:
> * Florian Weimer:

> 

>> * Adhemerval Zanella via Libc-alpha:

>>

>>> diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c

>>> new file mode 100644

>>> index 0000000000..a40e4447e1

>>> --- /dev/null

>>> +++ b/sysdeps/unix/sysv/linux/alpha/pread64.c

>>> @@ -0,0 +1,33 @@

>>> +/* Read from to a file descriptor at a given offset.  Linux/alpha version.

>>> +   Copyright (C) 2021 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

>>> +   <https://www.gnu.org/licenses/>.  */

>>> +

>>> +#define PREAD64_REQUIRE_PREAD_COMPAT

>>> +#include <sysdeps/unix/sysv/linux/pread64.c>

>>> +

>>> +/* libpthread compat symbols.  */

>>> +# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)

>>> +strong_alias (__libc_pread64, __compat_pread)

>>> +compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);

>>> +

>>> +strong_alias (__libc_pread64, __default_pread)

>>> +versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);

>>> +

>>> +/* It is a libc_hidden_def (__pread), but with a redirection due the symbol

>>> +   versioning.  */

>>> +__hidden_ver1 (__compat_pread, __GI___pread, __compat_pread);

>>> +#endif

>>

>> I believe this is libc_hidden_ver.  It took me a while to find it (see

>> the original dance around ___libc_once).

>>

>> This applies else where in this patch and also the pwrite patch.

> 

> Sorry, two more things: I don't quite see how alpha is an outlier here.

> 

> And ideally, this should receive the same treatment (and similar commit

> message) as lseek64 because I think we should switch from GLIBC_2.2

> symbols to GLIBC_2.1 for the default, and make the GLIBC_2.2 symbols

> compat versions.

> 

> Both comments apply to the pwrite change as well.


Alpha is outlier because it requires to handle a GLIBC_2_1 and
GLIBC_2_2 symbol versioning *also* for pread and __pread (not only
for LFS pread64 and __pread64 as usual LFS ABIs).
Zack Weinberg via Libc-alpha March 17, 2021, 8:04 p.m. | #5
* Adhemerval Zanella:

>> Sorry, two more things: I don't quite see how alpha is an outlier here.

>> 

>> And ideally, this should receive the same treatment (and similar commit

>> message) as lseek64 because I think we should switch from GLIBC_2.2

>> symbols to GLIBC_2.1 for the default, and make the GLIBC_2.2 symbols

>> compat versions.

>> 

>> Both comments apply to the pwrite change as well.

>

> Alpha is outlier because it requires to handle a GLIBC_2_1 and

> GLIBC_2_2 symbol versioning *also* for pread and __pread (not only

> for LFS pread64 and __pread64 as usual LFS ABIs).


Ah I see it now: mips64-linux-gnu-n64 has only this:

 1556: 0000000000109b70    300 FUNC    GLOBAL DEFAULT       12 __libc_pread@@GLIBC_PRIVATE
 2229: 0000000000109b70    300 FUNC    WEAK   DEFAULT       12 pread@@GLIBC_2.2

Likewise ia64-linux-gnu:

 1640: 00000000001bb180    528 FUNC    GLOBAL DEFAULT       11 __libc_pread@@GLIBC_PRIVATE
 2624: 00000000001bb180    528 FUNC    WEAK   DEFAULT       11 pread@@GLIBC_2.2

While i686-linux-gnu has:

 1327: 000f8480    218 FUNC    GLOBAL DEFAULT       13 __libc_pread@@GLIBC_PRIVATE
 2371: 000f8480    218 FUNC    GLOBAL DEFAULT       13 pread@@GLIBC_2.2
 2373: 000f8480    218 FUNC    GLOBAL DEFAULT       13 pread@GLIBC_2.1

And alpha-linux-gnu has:

 1406: 00000000000fc490    296 FUNC    GLOBAL DEFAULT       11 __libc_pread@@GLIBC_PRIVATE
 2522: 00000000000fc490    296 FUNC    GLOBAL DEFAULT       11 pread@@GLIBC_2.2
 2524: 00000000000fc490    296 FUNC    GLOBAL DEFAULT       11 pread@GLIBC_2.1

I compared it to the 32-bit ports …

It's a bit unfortunate that we have to pollute the generic code for
this.  But I don't see a way to avoid this if we bias the symbol version
towards pread@@GLIBC_2.1, to avoid the new pread@@GLIBC_2.34 symbol.

Thanks,
Florian
Joseph Myers March 17, 2021, 9:11 p.m. | #6
On Wed, 17 Mar 2021, Florian Weimer via Libc-alpha wrote:

> Ah I see it now: mips64-linux-gnu-n64 has only this:

> 

>  1556: 0000000000109b70    300 FUNC    GLOBAL DEFAULT       12 __libc_pread@@GLIBC_PRIVATE

>  2229: 0000000000109b70    300 FUNC    WEAK   DEFAULT       12 pread@@GLIBC_2.2


(Because MIPS didn't have glibc 2.1, so uses the shlib-versions feature of 
skipping all versions between GLIBC_2.0 and GLIBC_2.2 and mapping them to 
GLIBC_2.2.)

> Likewise ia64-linux-gnu:

> 

>  1640: 00000000001bb180    528 FUNC    GLOBAL DEFAULT       11 __libc_pread@@GLIBC_PRIVATE

>  2624: 00000000001bb180    528 FUNC    WEAK   DEFAULT       11 pread@@GLIBC_2.2


(Because ia64 symbol versions for many libraries start at GLIBC_2.2.)

-- 
Joseph S. Myers
joseph@codesourcery.com
Zack Weinberg via Libc-alpha March 18, 2021, 9:52 a.m. | #7
* Adhemerval Zanella via Libc-alpha:

> Yes and I simplified the versioned and compat definitions a bit with

> newer macros.


I've got something that should avoid the need for explicit aliases for
older binutils.

Thanks,
Florian
Zack Weinberg via Libc-alpha March 18, 2021, 10:09 a.m. | #8
* Joseph Myers:

> On Wed, 17 Mar 2021, Florian Weimer via Libc-alpha wrote:

>

>> Ah I see it now: mips64-linux-gnu-n64 has only this:

>> 

>>  1556: 0000000000109b70    300 FUNC    GLOBAL DEFAULT       12 __libc_pread@@GLIBC_PRIVATE

>>  2229: 0000000000109b70    300 FUNC    WEAK   DEFAULT       12 pread@@GLIBC_2.2

>

> (Because MIPS didn't have glibc 2.1, so uses the shlib-versions feature of 

> skipping all versions between GLIBC_2.0 and GLIBC_2.2 and mapping them to 

> GLIBC_2.2.)

>

>> Likewise ia64-linux-gnu:

>> 

>>  1640: 00000000001bb180    528 FUNC    GLOBAL DEFAULT       11 __libc_pread@@GLIBC_PRIVATE

>>  2624: 00000000001bb180    528 FUNC    WEAK   DEFAULT       11 pread@@GLIBC_2.2

>

> (Because ia64 symbol versions for many libraries start at GLIBC_2.2.)


Ahh, so alpha isn't really an outlier after all?

Adhemerval, would you please check if you can write a condition in
generic code using OTHERLIB_COMPAT (libpthread, …) with the appropriate
version ranges?

OTHERLIB_COMPAT would have to be defined like this:

diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index 4b224c2672..6303639f28 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -45,6 +45,14 @@
 
 #ifdef SHARED
 
+/* Like LIB_COMPAT, but can check versions in other libraries.  It is
+   not always false outside for !IS_IN (LIB).  */
+#define OTHERLIB_COMPAT(lib, introduced, obsoleted)	\
+  _LIB_COMPAT (lib, introduced, obsoleted)
+#define _OTHERLIB_COMPAT(lib, introduced, obsoleted)			\
+  (!(ABI_##lib##_##obsoleted - 0)					\
+   || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0)))
+
 /* Similar to LIB_COMPAT, but evaluate to 0 for static build.  The
    compatibility code should be conditionalized with e.g.
    `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
@@ -79,6 +87,7 @@
 #else
 
 /* Not compiling ELF shared libraries at all, so never any old versions.  */
+# define OTHERLIB_COMPAT(lib, introduced, obsoleted)	0
 # define SHLIB_COMPAT(lib, introduced, obsoleted)	0
 
 /* No versions to worry about, just make this the global definition.  */


Thanks,
Florian
Zack Weinberg via Libc-alpha March 19, 2021, 12:34 p.m. | #9
On 18/03/2021 07:09, Florian Weimer wrote:
> * Joseph Myers:

> 

>> On Wed, 17 Mar 2021, Florian Weimer via Libc-alpha wrote:

>>

>>> Ah I see it now: mips64-linux-gnu-n64 has only this:

>>>

>>>  1556: 0000000000109b70    300 FUNC    GLOBAL DEFAULT       12 __libc_pread@@GLIBC_PRIVATE

>>>  2229: 0000000000109b70    300 FUNC    WEAK   DEFAULT       12 pread@@GLIBC_2.2

>>

>> (Because MIPS didn't have glibc 2.1, so uses the shlib-versions feature of 

>> skipping all versions between GLIBC_2.0 and GLIBC_2.2 and mapping them to 

>> GLIBC_2.2.)

>>

>>> Likewise ia64-linux-gnu:

>>>

>>>  1640: 00000000001bb180    528 FUNC    GLOBAL DEFAULT       11 __libc_pread@@GLIBC_PRIVATE

>>>  2624: 00000000001bb180    528 FUNC    WEAK   DEFAULT       11 pread@@GLIBC_2.2

>>

>> (Because ia64 symbol versions for many libraries start at GLIBC_2.2.)

> 

> Ahh, so alpha isn't really an outlier after all?

> 

> Adhemerval, would you please check if you can write a condition in

> generic code using OTHERLIB_COMPAT (libpthread, …) with the appropriate

> version ranges?

> 

> OTHERLIB_COMPAT would have to be defined like this:

> 

> diff --git a/include/shlib-compat.h b/include/shlib-compat.h

> index 4b224c2672..6303639f28 100644

> --- a/include/shlib-compat.h

> +++ b/include/shlib-compat.h

> @@ -45,6 +45,14 @@

>  

>  #ifdef SHARED

>  

> +/* Like LIB_COMPAT, but can check versions in other libraries.  It is

> +   not always false outside for !IS_IN (LIB).  */

> +#define OTHERLIB_COMPAT(lib, introduced, obsoleted)	\

> +  _LIB_COMPAT (lib, introduced, obsoleted)


I think you meant _OTHERLIB_COMPAT here.

> +#define _OTHERLIB_COMPAT(lib, introduced, obsoleted)			\

> +  (!(ABI_##lib##_##obsoleted - 0)					\

> +   || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0)))

> +

>  /* Similar to LIB_COMPAT, but evaluate to 0 for static build.  The

>     compatibility code should be conditionalized with e.g.

>     `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced

> @@ -79,6 +87,7 @@

>  #else

>  

>  /* Not compiling ELF shared libraries at all, so never any old versions.  */

> +# define OTHERLIB_COMPAT(lib, introduced, obsoleted)	0

>  # define SHLIB_COMPAT(lib, introduced, obsoleted)	0

>  

>  /* No versions to worry about, just make this the global definition.  */


I tried, but the issue is although it fixes alpha it throws an error for
i386 with 'multiple definition of `pread@GLIBC_2.2' since its ABI also
exports the same symbol version *but* in a different TU (non-LFS Linux 
pread.c).

The issue alpha is currently the *only* ABI with has a versioned 
pread@GLIBC_2.2, but it is also a LFS as default so the its versioned 
pread@GLIBC_2.2 is an alias for __libc_pread64.

I think it would be simpler to just move this logic to an alpha
specific implementation, LFS is making this way more complex than it 
should be.
Florian Weimer March 19, 2021, 1:40 p.m. | #10
* Adhemerval Zanella via Libc-alpha:

> I tried, but the issue is although it fixes alpha it throws an error for

> i386 with 'multiple definition of `pread@GLIBC_2.2' since its ABI also

> exports the same symbol version *but* in a different TU (non-LFS Linux 

> pread.c).

>

> The issue alpha is currently the *only* ABI with has a versioned 

> pread@GLIBC_2.2, but it is also a LFS as default so the its versioned 

> pread@GLIBC_2.2 is an alias for __libc_pread64.


How does alpha maintain its current exception status?  I find it
difficult to understand how the present state is realized.
Zack Weinberg via Libc-alpha March 19, 2021, 4:51 p.m. | #11
On 19/03/2021 10:40, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:

> 

>> I tried, but the issue is although it fixes alpha it throws an error for

>> i386 with 'multiple definition of `pread@GLIBC_2.2' since its ABI also

>> exports the same symbol version *but* in a different TU (non-LFS Linux 

>> pread.c).

>>

>> The issue alpha is currently the *only* ABI with has a versioned 

>> pread@GLIBC_2.2, but it is also a LFS as default so the its versioned 

>> pread@GLIBC_2.2 is an alias for __libc_pread64.

> 

> How does alpha maintain its current exception status?  I find it

> difficult to understand how the present state is realized.

> 


Because the weak_alias does this automatically:

sysdeps/unix/sysv/linux/pread64.c

 35 weak_alias (__libc_pread64, pread)

$ readelf -s posix/pread64.os | grep -w pread
    21: 0000000000000000   288 FUNC    WEAK   DEFAULT [STD GPLOAD]     1 pread
$ readelf -s nptl/pread64.os | grep -w pread
    18: 0000000000000000   288 FUNC    WEAK   DEFAULT [STD GPLOAD]     1 pread

$ readelf -s nptl/libpthread.so | grep -w pread | head -n1
   182: 0000000000005850   288 FUNC    WEAK   DEFAULT [STD GPLOAD]    12 pread@@GLIBC_2.2

But I just figure out that I need to put the compat_symbol
within the __OFF_T_MATCHES_OFF64_T.

Patch

diff --git a/include/unistd.h b/include/unistd.h
index cdc31c3c0c..2d3698575c 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -47,7 +47,7 @@  extern ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes,
 			  __off64_t __offset);
 libc_hidden_proto (__pread64);
 extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes,
-			       __off64_t __offset) attribute_hidden;
+			       __off64_t __offset);
 extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n,
 			 __off_t __offset);
 libc_hidden_proto (__pwrite)
diff --git a/nptl/Makefile b/nptl/Makefile
index 9db14b788d..1a157ed0a6 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -81,7 +81,7 @@  static-only-routines = pthread_atfork
 # We need to provide certain routines for compatibility with existing
 # binaries.
 pthread-compat-wrappers = \
-		      pread pread64 pwrite pwrite64 \
+		      pwrite pwrite64 \
 		      tcdrain msgrcv msgsnd \
 		      sigwait sigsuspend \
 		      recvmsg sendmsg
@@ -284,8 +284,6 @@  CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-lockf.c += -fexceptions
-CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-sigwait.c += -fexceptions -fasynchronous-unwind-tables
diff --git a/nptl/Versions b/nptl/Versions
index 6875e370fe..71d48abcef 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -223,7 +223,6 @@  libpthread {
   }
 
   GLIBC_2.2 {
-    __pread64;
     __pthread_rwlock_destroy;
     __pthread_rwlock_init;
     __pthread_rwlock_rdlock;
@@ -233,8 +232,6 @@  libpthread {
     __pthread_rwlock_wrlock;
     __pwrite64;
     __res_state;
-    pread64;
-    pread;
     pthread_attr_getstack;
     pthread_attr_setstack;
     pthread_barrier_destroy;
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index e529be5383..1eda7db3b9 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.17 __h_errno_location F
 GLIBC_2.17 __libc_allocate_rtsig F
 GLIBC_2.17 __libc_current_sigrtmax F
 GLIBC_2.17 __libc_current_sigrtmin F
-GLIBC_2.17 __pread64 F
 GLIBC_2.17 __pthread_cleanup_routine F
 GLIBC_2.17 __pthread_getspecific F
 GLIBC_2.17 __pthread_key_create F
@@ -45,8 +44,6 @@  GLIBC_2.17 flockfile F
 GLIBC_2.17 ftrylockfile F
 GLIBC_2.17 funlockfile F
 GLIBC_2.17 longjmp F
-GLIBC_2.17 pread F
-GLIBC_2.17 pread64 F
 GLIBC_2.17 pthread_attr_getaffinity_np F
 GLIBC_2.17 pthread_attr_getguardsize F
 GLIBC_2.17 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index ef49b96bf8..3de66531a2 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -1847,6 +1847,7 @@  GLIBC_2.2 __fwriting F
 GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1934,6 +1935,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index b7c8e7649a..5181f0bca4 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -114,7 +114,6 @@  GLIBC_2.12 pthread_mutexattr_setrobust F
 GLIBC_2.12 pthread_setname_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -124,8 +123,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_setstack F
 GLIBC_2.2 pthread_barrier_destroy F
diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c
new file mode 100644
index 0000000000..a40e4447e1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/pread64.c
@@ -0,0 +1,33 @@ 
+/* Read from to a file descriptor at a given offset.  Linux/alpha version.
+   Copyright (C) 2021 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
+   <https://www.gnu.org/licenses/>.  */
+
+#define PREAD64_REQUIRE_PREAD_COMPAT
+#include <sysdeps/unix/sysv/linux/pread64.c>
+
+/* libpthread compat symbols.  */
+# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__libc_pread64, __compat_pread)
+compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);
+
+strong_alias (__libc_pread64, __default_pread)
+versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);
+
+/* It is a libc_hidden_def (__pread), but with a redirection due the symbol
+   versioning.  */
+__hidden_ver1 (__compat_pread, __GI___pread, __compat_pread);
+#endif
diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/libpthread.abilist
index 1340449c12..cf1d8d1754 100644
--- a/sysdeps/unix/sysv/linux/arc/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libpthread.abilist
@@ -6,7 +6,6 @@  GLIBC_2.32 __h_errno_location F
 GLIBC_2.32 __libc_allocate_rtsig F
 GLIBC_2.32 __libc_current_sigrtmax F
 GLIBC_2.32 __libc_current_sigrtmin F
-GLIBC_2.32 __pread64 F
 GLIBC_2.32 __pthread_cleanup_routine F
 GLIBC_2.32 __pthread_getspecific F
 GLIBC_2.32 __pthread_key_create F
@@ -55,8 +54,6 @@  GLIBC_2.32 mtx_lock F
 GLIBC_2.32 mtx_timedlock F
 GLIBC_2.32 mtx_trylock F
 GLIBC_2.32 mtx_unlock F
-GLIBC_2.32 pread F
-GLIBC_2.32 pread64 F
 GLIBC_2.32 pthread_attr_getaffinity_np F
 GLIBC_2.32 pthread_attr_getguardsize F
 GLIBC_2.32 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index b6bb718bfb..4debe42e86 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -42,7 +42,6 @@  GLIBC_2.4 __h_errno_location F
 GLIBC_2.4 __libc_allocate_rtsig F
 GLIBC_2.4 __libc_current_sigrtmax F
 GLIBC_2.4 __libc_current_sigrtmin F
-GLIBC_2.4 __pread64 F
 GLIBC_2.4 __pthread_cleanup_routine F
 GLIBC_2.4 __pthread_getspecific F
 GLIBC_2.4 __pthread_key_create F
@@ -80,8 +79,6 @@  GLIBC_2.4 flockfile F
 GLIBC_2.4 ftrylockfile F
 GLIBC_2.4 funlockfile F
 GLIBC_2.4 longjmp F
-GLIBC_2.4 pread F
-GLIBC_2.4 pread64 F
 GLIBC_2.4 pthread_attr_getaffinity_np F
 GLIBC_2.4 pthread_attr_getguardsize F
 GLIBC_2.4 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index b6bb718bfb..4debe42e86 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -42,7 +42,6 @@  GLIBC_2.4 __h_errno_location F
 GLIBC_2.4 __libc_allocate_rtsig F
 GLIBC_2.4 __libc_current_sigrtmax F
 GLIBC_2.4 __libc_current_sigrtmin F
-GLIBC_2.4 __pread64 F
 GLIBC_2.4 __pthread_cleanup_routine F
 GLIBC_2.4 __pthread_getspecific F
 GLIBC_2.4 __pthread_key_create F
@@ -80,8 +79,6 @@  GLIBC_2.4 flockfile F
 GLIBC_2.4 ftrylockfile F
 GLIBC_2.4 funlockfile F
 GLIBC_2.4 longjmp F
-GLIBC_2.4 pread F
-GLIBC_2.4 pread64 F
 GLIBC_2.4 pthread_attr_getaffinity_np F
 GLIBC_2.4 pthread_attr_getguardsize F
 GLIBC_2.4 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index 42ed9d4806..e27bcbf94f 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -6,7 +6,6 @@  GLIBC_2.29 __h_errno_location F
 GLIBC_2.29 __libc_allocate_rtsig F
 GLIBC_2.29 __libc_current_sigrtmax F
 GLIBC_2.29 __libc_current_sigrtmin F
-GLIBC_2.29 __pread64 F
 GLIBC_2.29 __pthread_cleanup_routine F
 GLIBC_2.29 __pthread_getspecific F
 GLIBC_2.29 __pthread_key_create F
@@ -55,8 +54,6 @@  GLIBC_2.29 mtx_lock F
 GLIBC_2.29 mtx_timedlock F
 GLIBC_2.29 mtx_trylock F
 GLIBC_2.29 mtx_unlock F
-GLIBC_2.29 pread F
-GLIBC_2.29 pread64 F
 GLIBC_2.29 pthread_attr_getaffinity_np F
 GLIBC_2.29 pthread_attr_getguardsize F
 GLIBC_2.29 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index 8f2f07f7dd..28b0a04d38 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -15,7 +15,6 @@  GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_getspecific F
 GLIBC_2.2 __pthread_key_create F
 GLIBC_2.2 __pthread_mutex_destroy F
@@ -47,8 +46,6 @@  GLIBC_2.2 flockfile F
 GLIBC_2.2 ftrylockfile F
 GLIBC_2.2 funlockfile F
 GLIBC_2.2 longjmp F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_atfork F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 759e488238..f88a24bb51 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -1851,6 +1851,7 @@  GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __lxstat64 F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1943,6 +1944,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index e46d881bc9..c67d62e7b8 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -114,7 +114,6 @@  GLIBC_2.12 pthread_mutexattr_setrobust F
 GLIBC_2.12 pthread_setname_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -124,8 +123,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_setstack F
 GLIBC_2.2 pthread_barrier_destroy F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index 8150296d80..a89c3d5cd5 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -15,7 +15,6 @@  GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_getspecific F
 GLIBC_2.2 __pthread_key_create F
 GLIBC_2.2 __pthread_mutex_destroy F
@@ -47,8 +46,6 @@  GLIBC_2.2 flockfile F
 GLIBC_2.2 ftrylockfile F
 GLIBC_2.2 funlockfile F
 GLIBC_2.2 longjmp F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_atfork F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index b6bb718bfb..4debe42e86 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -42,7 +42,6 @@  GLIBC_2.4 __h_errno_location F
 GLIBC_2.4 __libc_allocate_rtsig F
 GLIBC_2.4 __libc_current_sigrtmax F
 GLIBC_2.4 __libc_current_sigrtmin F
-GLIBC_2.4 __pread64 F
 GLIBC_2.4 __pthread_cleanup_routine F
 GLIBC_2.4 __pthread_getspecific F
 GLIBC_2.4 __pthread_key_create F
@@ -80,8 +79,6 @@  GLIBC_2.4 flockfile F
 GLIBC_2.4 ftrylockfile F
 GLIBC_2.4 funlockfile F
 GLIBC_2.4 longjmp F
-GLIBC_2.4 pread F
-GLIBC_2.4 pread64 F
 GLIBC_2.4 pthread_attr_getaffinity_np F
 GLIBC_2.4 pthread_attr_getguardsize F
 GLIBC_2.4 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 9f6b0adeaf..dd75512e35 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -1807,6 +1807,7 @@  GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __lxstat64 F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1899,6 +1900,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index e46d881bc9..c67d62e7b8 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -114,7 +114,6 @@  GLIBC_2.12 pthread_mutexattr_setrobust F
 GLIBC_2.12 pthread_setname_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -124,8 +123,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_setstack F
 GLIBC_2.2 pthread_barrier_destroy F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index d0c73a7a09..4c8394fdf4 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.18 __h_errno_location F
 GLIBC_2.18 __libc_allocate_rtsig F
 GLIBC_2.18 __libc_current_sigrtmax F
 GLIBC_2.18 __libc_current_sigrtmin F
-GLIBC_2.18 __pread64 F
 GLIBC_2.18 __pthread_cleanup_routine F
 GLIBC_2.18 __pthread_getspecific F
 GLIBC_2.18 __pthread_key_create F
@@ -45,8 +44,6 @@  GLIBC_2.18 flockfile F
 GLIBC_2.18 ftrylockfile F
 GLIBC_2.18 funlockfile F
 GLIBC_2.18 longjmp F
-GLIBC_2.18 pread F
-GLIBC_2.18 pread64 F
 GLIBC_2.18 pthread_attr_getaffinity_np F
 GLIBC_2.18 pthread_attr_getguardsize F
 GLIBC_2.18 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index d0c73a7a09..4c8394fdf4 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.18 __h_errno_location F
 GLIBC_2.18 __libc_allocate_rtsig F
 GLIBC_2.18 __libc_current_sigrtmax F
 GLIBC_2.18 __libc_current_sigrtmin F
-GLIBC_2.18 __pread64 F
 GLIBC_2.18 __pthread_cleanup_routine F
 GLIBC_2.18 __pthread_getspecific F
 GLIBC_2.18 __pthread_key_create F
@@ -45,8 +44,6 @@  GLIBC_2.18 flockfile F
 GLIBC_2.18 ftrylockfile F
 GLIBC_2.18 funlockfile F
 GLIBC_2.18 longjmp F
-GLIBC_2.18 pread F
-GLIBC_2.18 pread64 F
 GLIBC_2.18 pthread_attr_getaffinity_np F
 GLIBC_2.18 pthread_attr_getguardsize F
 GLIBC_2.18 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index ffc99c55d3..2c5b6b493e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -80,7 +80,6 @@  GLIBC_2.18 pthread_setattr_default_np F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -90,8 +89,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_getstackaddr F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index ffc99c55d3..2c5b6b493e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -80,7 +80,6 @@  GLIBC_2.18 pthread_setattr_default_np F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -90,8 +89,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_getstackaddr F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index d161549015..fa77adb3e6 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.21 __h_errno_location F
 GLIBC_2.21 __libc_allocate_rtsig F
 GLIBC_2.21 __libc_current_sigrtmax F
 GLIBC_2.21 __libc_current_sigrtmin F
-GLIBC_2.21 __pread64 F
 GLIBC_2.21 __pthread_cleanup_routine F
 GLIBC_2.21 __pthread_getspecific F
 GLIBC_2.21 __pthread_key_create F
@@ -45,8 +44,6 @@  GLIBC_2.21 flockfile F
 GLIBC_2.21 ftrylockfile F
 GLIBC_2.21 funlockfile F
 GLIBC_2.21 longjmp F
-GLIBC_2.21 pread F
-GLIBC_2.21 pread64 F
 GLIBC_2.21 pthread_attr_getaffinity_np F
 GLIBC_2.21 pthread_attr_getguardsize F
 GLIBC_2.21 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 1861a901e9..aa622a5415 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -1813,6 +1813,7 @@  GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __lxstat64 F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1904,6 +1905,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index f136045eda..41c3ff53af 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -114,7 +114,6 @@  GLIBC_2.12 pthread_mutexattr_setrobust F
 GLIBC_2.12 pthread_setname_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -124,8 +123,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_setstack F
 GLIBC_2.2 pthread_barrier_destroy F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 20c9c6cba4..f9840c739f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -1817,6 +1817,7 @@  GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __lxstat64 F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1908,6 +1909,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
index 863ef63c2f..52506ec828 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
@@ -36,7 +36,6 @@  GLIBC_2.3 __h_errno_location F
 GLIBC_2.3 __libc_allocate_rtsig F
 GLIBC_2.3 __libc_current_sigrtmax F
 GLIBC_2.3 __libc_current_sigrtmin F
-GLIBC_2.3 __pread64 F
 GLIBC_2.3 __pthread_getspecific F
 GLIBC_2.3 __pthread_key_create F
 GLIBC_2.3 __pthread_mutex_destroy F
@@ -68,8 +67,6 @@  GLIBC_2.3 flockfile F
 GLIBC_2.3 ftrylockfile F
 GLIBC_2.3 funlockfile F
 GLIBC_2.3 longjmp F
-GLIBC_2.3 pread F
-GLIBC_2.3 pread64 F
 GLIBC_2.3 pthread_attr_getguardsize F
 GLIBC_2.3 pthread_attr_getstack F
 GLIBC_2.3 pthread_attr_getstackaddr F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
index e529be5383..1eda7db3b9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.17 __h_errno_location F
 GLIBC_2.17 __libc_allocate_rtsig F
 GLIBC_2.17 __libc_current_sigrtmax F
 GLIBC_2.17 __libc_current_sigrtmin F
-GLIBC_2.17 __pread64 F
 GLIBC_2.17 __pthread_cleanup_routine F
 GLIBC_2.17 __pthread_getspecific F
 GLIBC_2.17 __pthread_key_create F
@@ -45,8 +44,6 @@  GLIBC_2.17 flockfile F
 GLIBC_2.17 ftrylockfile F
 GLIBC_2.17 funlockfile F
 GLIBC_2.17 longjmp F
-GLIBC_2.17 pread F
-GLIBC_2.17 pread64 F
 GLIBC_2.17 pthread_attr_getaffinity_np F
 GLIBC_2.17 pthread_attr_getguardsize F
 GLIBC_2.17 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index 2574c97331..9b6e566c80 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -18,6 +18,7 @@ 
 
 #include <unistd.h>
 #include <sysdep-cancel.h>
+#include <shlib-compat.h>
 
 #ifndef __OFF_T_MATCHES_OFF64_T
 
@@ -27,7 +28,19 @@  __libc_pread (int fd, void *buf, size_t count, off_t offset)
   return SYSCALL_CANCEL (pread64, fd, buf, count, SYSCALL_LL_PRW (offset));
 }
 
+# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__libc_pread, __compat_pread)
+compat_symbol (libc, __compat_pread, pread, GLIBC_2_1);
+
+strong_alias (__libc_pread, __default_pread)
+versioned_symbol (libc, __default_pread, pread, GLIBC_2_2);
+
+/* It is a libc_hidden_def (__pread64), but with a redirection due the symbol
+   versioning.  */
+__hidden_ver1 (__libc_pread, __GI___pread, __libc_pread);
+# else
 strong_alias (__libc_pread, __pread)
 libc_hidden_weak (__pread)
 weak_alias (__libc_pread, pread)
+# endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index 83c6896a18..c652bab269 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -18,6 +18,7 @@ 
 
 #include <unistd.h>
 #include <sysdep-cancel.h>
+#include <shlib-compat.h>
 
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
@@ -25,12 +26,31 @@  __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
   return SYSCALL_CANCEL (pread64, fd, buf, count, SYSCALL_LL64_PRW (offset));
 }
 
-weak_alias (__libc_pread64, __pread64)
-libc_hidden_weak (__pread64)
-weak_alias (__libc_pread64, pread64)
-
 #ifdef __OFF_T_MATCHES_OFF64_T
 strong_alias (__libc_pread64, __libc_pread)
+/* Similar to non-LFS symbol, alpha requires compat symbols for pread.  */
+# ifndef PREAD64_REQUIRE_PREAD_COMPAT
 weak_alias (__libc_pread64, __pread)
 weak_alias (__libc_pread64, pread)
+# endif
+#endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__libc_pread64, __compat_pread64)
+compat_symbol (libc, __compat_pread64, pread64, GLIBC_2_1);
+strong_alias (__libc_pread64, __compat___pread64)
+compat_symbol (libc, __compat___pread64, __pread64, GLIBC_2_1);
+
+strong_alias (__libc_pread64, __default___pread64)
+versioned_symbol (libc, __default___pread64, __pread64, GLIBC_2_2);
+strong_alias (__libc_pread64, __default_pread64)
+versioned_symbol (libc, __default_pread64, pread64, GLIBC_2_2);
+
+/* It is a libc_hidden_def (__pread64), but with a redirection due the symbol
+   versioning.  */
+__hidden_ver1 (__libc_pread64, __GI___pread64, __libc_pread64);
+#else
+weak_alias (__libc_pread64, __pread64)
+libc_hidden_weak (__pread64)
+weak_alias (__libc_pread64, pread64)
 #endif
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
index 8710afde8f..b6a626ebcc 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
@@ -6,7 +6,6 @@  GLIBC_2.33 __h_errno_location F
 GLIBC_2.33 __libc_allocate_rtsig F
 GLIBC_2.33 __libc_current_sigrtmax F
 GLIBC_2.33 __libc_current_sigrtmin F
-GLIBC_2.33 __pread64 F
 GLIBC_2.33 __pthread_cleanup_routine F
 GLIBC_2.33 __pthread_getspecific F
 GLIBC_2.33 __pthread_key_create F
@@ -55,8 +54,6 @@  GLIBC_2.33 mtx_lock F
 GLIBC_2.33 mtx_timedlock F
 GLIBC_2.33 mtx_trylock F
 GLIBC_2.33 mtx_unlock F
-GLIBC_2.33 pread F
-GLIBC_2.33 pread64 F
 GLIBC_2.33 pthread_attr_getaffinity_np F
 GLIBC_2.33 pthread_attr_getguardsize F
 GLIBC_2.33 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
index f401e97095..e9a354002f 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.27 __h_errno_location F
 GLIBC_2.27 __libc_allocate_rtsig F
 GLIBC_2.27 __libc_current_sigrtmax F
 GLIBC_2.27 __libc_current_sigrtmin F
-GLIBC_2.27 __pread64 F
 GLIBC_2.27 __pthread_cleanup_routine F
 GLIBC_2.27 __pthread_getspecific F
 GLIBC_2.27 __pthread_key_create F
@@ -44,8 +43,6 @@  GLIBC_2.27 fcntl F
 GLIBC_2.27 flockfile F
 GLIBC_2.27 ftrylockfile F
 GLIBC_2.27 funlockfile F
-GLIBC_2.27 pread F
-GLIBC_2.27 pread64 F
 GLIBC_2.27 pthread_attr_getaffinity_np F
 GLIBC_2.27 pthread_attr_getguardsize F
 GLIBC_2.27 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index d821c145a0..2164777ce1 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -1811,6 +1811,7 @@  GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __lxstat64 F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1902,6 +1903,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index 30cc87bcbe..ae20386d5a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -116,7 +116,6 @@  GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_setattr_default_np F
 GLIBC_2.19 longjmp F
 GLIBC_2.19 siglongjmp F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -126,8 +125,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_setstack F
 GLIBC_2.2 pthread_barrier_destroy F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index f69a9e8268..5d1b0f53aa 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -17,7 +17,6 @@  GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_getspecific F
 GLIBC_2.2 __pthread_key_create F
 GLIBC_2.2 __pthread_mutex_destroy F
@@ -49,8 +48,6 @@  GLIBC_2.2 flockfile F
 GLIBC_2.2 ftrylockfile F
 GLIBC_2.2 funlockfile F
 GLIBC_2.2 longjmp F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_atfork F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index 8f2f07f7dd..28b0a04d38 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -15,7 +15,6 @@  GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_getspecific F
 GLIBC_2.2 __pthread_key_create F
 GLIBC_2.2 __pthread_mutex_destroy F
@@ -47,8 +46,6 @@  GLIBC_2.2 flockfile F
 GLIBC_2.2 ftrylockfile F
 GLIBC_2.2 funlockfile F
 GLIBC_2.2 longjmp F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_atfork F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index 8f2f07f7dd..28b0a04d38 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -15,7 +15,6 @@  GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_getspecific F
 GLIBC_2.2 __pthread_key_create F
 GLIBC_2.2 __pthread_mutex_destroy F
@@ -47,8 +46,6 @@  GLIBC_2.2 flockfile F
 GLIBC_2.2 ftrylockfile F
 GLIBC_2.2 funlockfile F
 GLIBC_2.2 longjmp F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_atfork F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 7006678a9a..0b28566840 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -1809,6 +1809,7 @@  GLIBC_2.2 __getmntent_r F
 GLIBC_2.2 __lxstat64 F
 GLIBC_2.2 __nl_langinfo_l F
 GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
 GLIBC_2.2 __res_init F
 GLIBC_2.2 __res_nclose F
 GLIBC_2.2 __res_ninit F
@@ -1898,6 +1899,8 @@  GLIBC_2.2 posix_spawnattr_setschedpolicy F
 GLIBC_2.2 posix_spawnattr_setsigdefault F
 GLIBC_2.2 posix_spawnattr_setsigmask F
 GLIBC_2.2 posix_spawnp F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
 GLIBC_2.2 putwc F
 GLIBC_2.2 putwc_unlocked F
 GLIBC_2.2 putwchar F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index b7c8e7649a..5181f0bca4 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -114,7 +114,6 @@  GLIBC_2.12 pthread_mutexattr_setrobust F
 GLIBC_2.12 pthread_setname_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
 GLIBC_2.2 __pthread_rwlock_init F
 GLIBC_2.2 __pthread_rwlock_rdlock F
@@ -124,8 +123,6 @@  GLIBC_2.2 __pthread_rwlock_unlock F
 GLIBC_2.2 __pthread_rwlock_wrlock F
 GLIBC_2.2 __pwrite64 F
 GLIBC_2.2 __res_state F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_attr_getstack F
 GLIBC_2.2 pthread_attr_setstack F
 GLIBC_2.2 pthread_barrier_destroy F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index 8150296d80..a89c3d5cd5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -15,7 +15,6 @@  GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_getspecific F
 GLIBC_2.2 __pthread_key_create F
 GLIBC_2.2 __pthread_mutex_destroy F
@@ -47,8 +46,6 @@  GLIBC_2.2 flockfile F
 GLIBC_2.2 ftrylockfile F
 GLIBC_2.2 funlockfile F
 GLIBC_2.2 longjmp F
-GLIBC_2.2 pread F
-GLIBC_2.2 pread64 F
 GLIBC_2.2 pthread_atfork F
 GLIBC_2.2 pthread_attr_getguardsize F
 GLIBC_2.2 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index 96d38ae1e4..cfdd8e7659 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -15,7 +15,6 @@  GLIBC_2.2.5 __h_errno_location F
 GLIBC_2.2.5 __libc_allocate_rtsig F
 GLIBC_2.2.5 __libc_current_sigrtmax F
 GLIBC_2.2.5 __libc_current_sigrtmin F
-GLIBC_2.2.5 __pread64 F
 GLIBC_2.2.5 __pthread_getspecific F
 GLIBC_2.2.5 __pthread_key_create F
 GLIBC_2.2.5 __pthread_mutex_destroy F
@@ -47,8 +46,6 @@  GLIBC_2.2.5 flockfile F
 GLIBC_2.2.5 ftrylockfile F
 GLIBC_2.2.5 funlockfile F
 GLIBC_2.2.5 longjmp F
-GLIBC_2.2.5 pread F
-GLIBC_2.2.5 pread64 F
 GLIBC_2.2.5 pthread_atfork F
 GLIBC_2.2.5 pthread_attr_getguardsize F
 GLIBC_2.2.5 pthread_attr_getstack F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 2573133ed2..e0ec1fd114 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -7,7 +7,6 @@  GLIBC_2.16 __h_errno_location F
 GLIBC_2.16 __libc_allocate_rtsig F
 GLIBC_2.16 __libc_current_sigrtmax F
 GLIBC_2.16 __libc_current_sigrtmin F
-GLIBC_2.16 __pread64 F
 GLIBC_2.16 __pthread_cleanup_routine F
 GLIBC_2.16 __pthread_getspecific F
 GLIBC_2.16 __pthread_key_create F
@@ -45,8 +44,6 @@  GLIBC_2.16 flockfile F
 GLIBC_2.16 ftrylockfile F
 GLIBC_2.16 funlockfile F
 GLIBC_2.16 longjmp F
-GLIBC_2.16 pread F
-GLIBC_2.16 pread64 F
 GLIBC_2.16 pthread_attr_getaffinity_np F
 GLIBC_2.16 pthread_attr_getguardsize F
 GLIBC_2.16 pthread_attr_getstack F