diff --git a/sysdeps/unix/sysv/linux/alpha/getrlimit64.c b/sysdeps/unix/sysv/linux/alpha/getrlimit64.c
index 25cf4aa..d8ac917 100644
--- a/sysdeps/unix/sysv/linux/alpha/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/alpha/getrlimit64.c
@@ -15,40 +15,12 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <sys/types.h>
-#include <shlib-compat.h>
-
-/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
-   linking getrlimit64 to {__}getrlimit does not throw a type error.  */
-#undef getrlimit
-#undef __getrlimit
-#define getrlimit getrlimit_redirect
-#define __getrlimit __getrlimit_redirect
-#include <sys/resource.h>
-#undef getrlimit
-#undef __getrlimit
-
-
-/* Put the soft and hard limits for RESOURCE in *RLIMITS.
-   Returns 0 if successful, -1 if not (and sets errno).  */
-int
-__getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
-{
-  return INLINE_SYSCALL_CALL (prlimit64, 0, resource, NULL, rlimits);
-}
-libc_hidden_def (__getrlimit64)
-
-strong_alias (__getrlimit64, __GI_getrlimit)
-strong_alias (__getrlimit64, __GI_getrlimit64)
-strong_alias (__getrlimit64, __GI___getrlimit)
-strong_alias (__getrlimit64, __getrlimit)
-
+#define USE_VERSIONED_RLIMIT
+#include <sysdeps/unix/sysv/linux/getrlimit64.c>
 versioned_symbol (libc, __getrlimit, getrlimit, GLIBC_2_27);
 versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_27);
 
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27) \
-    || SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_27)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27)
 /* RLIM64_INFINITY was supposed to be a glibc convention rather than
    anything seen by the kernel, but it ended being passed to the kernel
    through the prlimit64 syscall.  Given that a lot of binaries with
@@ -78,11 +50,7 @@ __old_getrlimit64 (enum __rlimit_resource resource,
   return 0;
 }
 
-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27)
 strong_alias (__old_getrlimit64, __old_getrlimit)
 compat_symbol (libc, __old_getrlimit, getrlimit, GLIBC_2_0);
-# endif
-# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_27)
 compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
-# endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/alpha/setrlimit64.c b/sysdeps/unix/sysv/linux/alpha/setrlimit64.c
index b8074d2..1735f68 100644
--- a/sysdeps/unix/sysv/linux/alpha/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/alpha/setrlimit64.c
@@ -15,38 +15,12 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <sys/types.h>
-#include <shlib-compat.h>
-
-/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
-   linking setrlimit64 to {__}setrlimit does not throw a type error.  */
-#undef setrlimit
-#undef __setrlimit
-#define setrlimit setrlimit_redirect
-#define __setrlimit __setrlimit_redirect
-#include <sys/resource.h>
-#undef setrlimit
-#undef __setrlimit
-
-/* Set the soft and hard limits for RESOURCE to *RLIMITS.
-   Only the super-user can increase hard limits.
-   Return 0 if successful, -1 if not (and sets errno).  */
-int
-__setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
-{
-  return INLINE_SYSCALL_CALL (prlimit64, 0, resource, rlimits, NULL);
-}
-strong_alias (__setrlimit64, __setrlimit)
-# ifdef SHARED
-__hidden_ver1 (__setrlimit64, __GI___setrlimit, __setrlimit64);
-# endif
-
+#define USE_VERSIONED_RLIMIT
+#include <sysdeps/unix/sysv/linux/setrlimit64.c>
 versioned_symbol (libc, __setrlimit, setrlimit, GLIBC_2_27);
 versioned_symbol (libc, __setrlimit64, setrlimit64, GLIBC_2_27);
 
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27) \
-    || SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_27)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27)
 /* RLIM64_INFINITY was supposed to be a glibc convention rather than
    anything seen by the kernel, but it ended being passed to the kernel
    through the prlimit64 syscall.  Given that a lot of binaries with
@@ -73,11 +47,7 @@ __old_setrlimit64 (enum __rlimit_resource resource,
   return __setrlimit64 (resource, &krlimits);
 }
 
-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27)
 strong_alias (__old_setrlimit64, __old_setrlimit)
 compat_symbol (libc, __old_setrlimit, setrlimit, GLIBC_2_0);
-# endif
-# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_27)
 compat_symbol (libc, __old_setrlimit64, setrlimit64, GLIBC_2_1);
-# endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/getrlimit64.c b/sysdeps/unix/sysv/linux/getrlimit64.c
index 37827e5..d14fc63 100644
--- a/sysdeps/unix/sysv/linux/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/getrlimit64.c
@@ -45,13 +45,16 @@ libc_hidden_def (__getrlimit64)
 strong_alias (__getrlimit64, __GI_getrlimit)
 strong_alias (__getrlimit64, __GI___getrlimit)
 strong_alias (__getrlimit64, __getrlimit)
+/* Alpha defines a versioned getrlimit{64}.  */
+# ifndef USE_VERSIONED_RLIMIT
 weak_alias (__getrlimit64, getrlimit)
-/* And there is no need for compat symbols.  */
-# undef SHLIB_COMPAT
-# define SHLIB_COMPAT(a, b, c) 0
-#endif
+weak_alias (__getrlimit64, getrlimit64)
+libc_hidden_weak (getrlimit64)
+# else
+weak_alias (__getrlimit64, __GI_getrlimit64)
+# endif
 
-#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+#elif if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
 /* Back compatible 2GiB limited rlimit.  */
 extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *)
   attribute_hidden;
@@ -82,7 +85,4 @@ __old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
 }
 versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
 compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
-#else
-weak_alias (__getrlimit64, getrlimit64)
-libc_hidden_weak (getrlimit64)
-#endif
+#endif /* __RLIM_T_MATCHES_RLIM64_T  */
diff --git a/sysdeps/unix/sysv/linux/setrlimit64.c b/sysdeps/unix/sysv/linux/setrlimit64.c
index ff835c8..0f5cc85 100644
--- a/sysdeps/unix/sysv/linux/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/setrlimit64.c
@@ -38,11 +38,16 @@ __setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
 {
   return INLINE_SYSCALL_CALL (prlimit64, 0, resource, rlimits, NULL);
 }
+/* Alpha defines a versioned setrlimit{64}.  */
+#ifndef USE_VERSIONED_RLIMIT
 weak_alias (__setrlimit64, setrlimit64)
+#endif
 
 #if __RLIM_T_MATCHES_RLIM64_T
 strong_alias (__setrlimit64, __setrlimit)
+# ifndef USE_VERSIONED_RLIMIT
 weak_alias (__setrlimit64, setrlimit)
+# endif
 # ifdef SHARED
 __hidden_ver1 (__setrlimit64, __GI___setrlimit, __setrlimit64);
 # endif
