diff --git a/math/Versions b/math/Versions
index a576097c50..27d4e94613 100644
--- a/math/Versions
+++ b/math/Versions
@@ -678,5 +678,6 @@ libm {
     acosf;
     asinf;
     acoshf;
+    atan2f;
   }
 }
diff --git a/math/w_atan2f.c b/math/w_atan2f.c
new file mode 100644
index 0000000000..9b3d6c4bbf
--- /dev/null
+++ b/math/w_atan2f.c
@@ -0,0 +1,8 @@
+#include <math-type-macros-float.h>
+#undef __USE_WRAPPER_TEMPLATE
+#define __USE_WRAPPER_TEMPLATE 1
+#undef declare_mgen_alias
+#define declare_mgen_alias(a, b)
+#include <w_atan2_template.c>
+versioned_symbol (libm, __atan2f, atan2f, GLIBC_2_42);
+libm_alias_float_other (__atan2f, atan2f)
diff --git a/math/w_atan2f_compat.c b/math/w_atan2f_compat.c
index 047f853f2c..28589a7c35 100644
--- a/math/w_atan2f_compat.c
+++ b/math/w_atan2f_compat.c
@@ -26,9 +26,9 @@
 #include <libm-alias-float.h>
 
 
-#if LIBM_SVID_COMPAT
+#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_42)
 float
-__atan2f (float y, float x)
+__atan2_compatf (float y, float x)
 {
   float z;
 
@@ -40,5 +40,10 @@ __atan2f (float y, float x)
     __set_errno (ERANGE);
   return z;
 }
-libm_alias_float (__atan2, atan2)
+# ifdef NO_COMPAT_NEEDED
+strong_alias (__atan2_compatf, __atan2f)
+libm_alias_float (__atan2_compat, atan2)
+# else
+compat_symbol (libm, __atan2_compatf, atan2f, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/ieee754/flt-32/e_atan2f.c b/sysdeps/ieee754/flt-32/e_atan2f.c
index 82a0151293..19906b68dd 100644
--- a/sysdeps/ieee754/flt-32/e_atan2f.c
+++ b/sysdeps/ieee754/flt-32/e_atan2f.c
@@ -3,7 +3,7 @@
 Copyright (c) 2022-2024 Alexei Sibidanov and Paul Zimmermann.
 
 The original version of this file was copied from the CORE-MATH
-project (file src/binary32/atan2/atan2f.c, revision 7835c5d).
+project (file src/binary32/atan2/atan2f.c, revision 9b28a4a).
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -25,9 +25,12 @@ SOFTWARE.
 
 */
 
+#include <errno.h>
 #include <math.h>
 #include <stdint.h>
 #include <libm-alias-finite.h>
+#include <libm-alias-float.h>
+#include <math-svid-compat.h>
 #include "math_config.h"
 
 static inline double
@@ -89,7 +92,7 @@ cr_atan2f_tiny (float y, float x)
 }
 
 float
-__ieee754_atan2f (float y, float x)
+__atan2f (float y, float x)
 {
   static const double cn[] =
     {
@@ -269,6 +272,16 @@ __ieee754_atan2f (float y, float x)
 	}
       r = th + tm;
     }
-  return r;
+  float rf = r;
+  if (__glibc_unlikely (rf == 0 && y != 0))
+    __set_errno (ERANGE);
+  return rf;
 }
+strong_alias (__atan2f, __ieee754_atan2f)
+#if LIBM_SVID_COMPAT
+versioned_symbol (libm, __atan2f, atan2f, GLIBC_2_42);
+libm_alias_float_other (__atan2, atan2)
+#else
+libm_alias_float (__atan2, atan2)
+#endif
 libm_alias_finite (__ieee754_atan2f, __atan2f)
diff --git a/sysdeps/ieee754/flt-32/w_atan2f.c b/sysdeps/ieee754/flt-32/w_atan2f.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/w_atan2f.c
@@ -0,0 +1 @@
+/* Not needed.  */
diff --git a/sysdeps/m68k/m680x0/fpu/w_atan2f_compat.c b/sysdeps/m68k/m680x0/fpu/w_atan2f_compat.c
new file mode 100644
index 0000000000..ebc8035961
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_atan2f_compat.c
@@ -0,0 +1,8 @@
+/* m68k provides an optimized __ieee754_atan2f.  */
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_atan2f_compat.c>
+#else
+# include <math-type-macros-float.h>
+# include <w_atan2_template.c>
+#endif
diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist
index b6f55e1e85..8eceffc54c 100644
--- a/sysdeps/mach/hurd/i386/libm.abilist
+++ b/sysdeps/mach/hurd/i386/libm.abilist
@@ -1280,6 +1280,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
index c939ada587..bd9687e60c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
@@ -1248,6 +1248,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/alpha/libm.abilist b/sysdeps/unix/sysv/linux/alpha/libm.abilist
index 7e1d0cef30..b2a66c4ede 100644
--- a/sysdeps/unix/sysv/linux/alpha/libm.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libm.abilist
@@ -1407,6 +1407,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libm.abilist b/sysdeps/unix/sysv/linux/arm/be/libm.abilist
index c6ef147356..92b172b839 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libm.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libm.abilist b/sysdeps/unix/sysv/linux/arm/le/libm.abilist
index c6ef147356..92b172b839 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libm.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/hppa/libm.abilist b/sysdeps/unix/sysv/linux/hppa/libm.abilist
index 40050fbb6a..ce8a833cfc 100644
--- a/sysdeps/unix/sysv/linux/hppa/libm.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist
index 7b63fa103c..37f8c436a3 100644
--- a/sysdeps/unix/sysv/linux/i386/libm.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libm.abilist
@@ -1287,6 +1287,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
index c6ef147356..92b172b839 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libm.abilist
index a5f5762406..efd11d19cf 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libm.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libm.abilist
index a5f5762406..efd11d19cf 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libm.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
index ce75033ac7..743a4d0637 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
index b10a87aa26..b9c859570e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
@@ -1248,6 +1248,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
index 36ce6efc66..52136c4528 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
@@ -1070,6 +1070,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
index b9dc71ae16..c9c82a80c5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
@@ -1069,6 +1069,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist
index ae997f0052..a88fb21bed 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist
@@ -1063,6 +1063,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist
index 68a2bad6df..35bd7e7773 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist
@@ -1432,6 +1432,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
index 0331713c1a..f6d0d69ec6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
@@ -1351,6 +1351,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
index da49e189f5..917db48912 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
@@ -1351,6 +1351,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libm.abilist b/sysdeps/unix/sysv/linux/sh/be/libm.abilist
index a3fc39e3cb..6cf910173b 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libm.abilist b/sysdeps/unix/sysv/linux/sh/le/libm.abilist
index a3fc39e3cb..6cf910173b 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libm.abilist
@@ -923,6 +923,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
index 42bce13b21..1ec1808524 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
@@ -1358,6 +1358,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
index 2f2a699b6c..3de2c3d660 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
@@ -1248,6 +1248,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
index 4291327fce..cbc17fcd2a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
@@ -1281,6 +1281,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
index 9a3c7fb596..d6ddaf0c7a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
@@ -1281,6 +1281,7 @@ GLIBC_2.41 tanpil F
 GLIBC_2.42 acosf F
 GLIBC_2.42 acoshf F
 GLIBC_2.42 asinf F
+GLIBC_2.42 atan2f F
 GLIBC_2.42 lgammaf F
 GLIBC_2.42 lgammaf_r F
 GLIBC_2.42 log10f F
