[PATCH 15/30] nptl: Remove pread from libpthread
Florian Weimer
fweimer@redhat.com
Thu Mar 18 10:09:09 GMT 2021
* 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
More information about the Libc-alpha
mailing list