]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add OTHER_SHLIB_COMPAT
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 19 Mar 2021 17:21:05 +0000 (17:21 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 26 Mar 2021 16:36:16 +0000 (13:36 -0300)
It is similar to SHLIB_COMPAT, but allows to check versions from
other libraries.  It is used to move compat symbol from other libraries
to libc.

include/shlib-compat.h

index 537851d7531864cda102337654a84b9e25503011..6c423c8cb026362e1e7c7bde07ae9f55bac5a473 100644 (file)
 # define SHLIB_COMPAT(lib, introduced, obsoleted)                            \
   _LIB_COMPAT (lib, introduced, obsoleted)
 
+/* Like SHLIB_COMPAT, but it can check versions in other libraries.  It is
+   not always false for !IS_IN (LIB).  */
+#define OTHER_SHLIB_COMPAT(lib, introduced, obsoleted) \
+  _OTHER_SHLIB_COMPAT (lib, introduced, obsoleted)
+#define _OTHER_SHLIB_COMPAT(lib, introduced, obsoleted)                        \
+  (!(ABI_##lib##_##obsoleted - 0)                                      \
+   || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0)))
+
 /* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
    the version set name to use for e.g. symbols first introduced into
    libm in the GLIBC_2.1 version.  Definitions of symbols with explicit
 
 /* Not compiling ELF shared libraries at all, so never any old versions.  */
 # define SHLIB_COMPAT(lib, introduced, obsoleted)      0
+# define OTHER_SHLIB_COMPAT(lib, introduced, obsoleted)        0
 
 /* No versions to worry about, just make this the global definition.  */
 # define versioned_symbol(lib, local, symbol, version) \