e6e23a
Move _dl_dso_sort_algo out of _rtld_global_ro.  It is only used
e6e23a
locally in elf/dl-sort-maps.c.  This avoids changing the internal
e6e23a
_rtld_global_ro ABI.
e6e23a
e6e23a
diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
e6e23a
index 6f5c17b47b98fbc7..aeb79b40b45054c0 100644
e6e23a
--- a/elf/dl-sort-maps.c
e6e23a
+++ b/elf/dl-sort-maps.c
e6e23a
@@ -290,12 +290,21 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
e6e23a
     }
e6e23a
 }
e6e23a
 
e6e23a
+/* DSO sort algorithm to use.  */
e6e23a
+enum dso_sort_algorithm
e6e23a
+  {
e6e23a
+    dso_sort_algorithm_original,
e6e23a
+    dso_sort_algorithm_dfs
e6e23a
+  };
e6e23a
+
e6e23a
+static enum dso_sort_algorithm _dl_dso_sort_algo;
e6e23a
+
e6e23a
 void
e6e23a
 _dl_sort_maps_init (void)
e6e23a
 {
e6e23a
   int32_t algorithm = TUNABLE_GET (glibc, rtld, dynamic_sort, int32_t, NULL);
e6e23a
-  GLRO(dl_dso_sort_algo) = algorithm == 1 ? dso_sort_algorithm_original
e6e23a
-					  : dso_sort_algorithm_dfs;
e6e23a
+  _dl_dso_sort_algo = (algorithm == 1 ? dso_sort_algorithm_original
e6e23a
+		       : dso_sort_algorithm_dfs);
e6e23a
 }
e6e23a
 
e6e23a
 void
e6e23a
@@ -309,7 +318,7 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
e6e23a
      PTR_MANGLE/DEMANGLE, further impairing performance of small, common
e6e23a
      input cases. A simple if-case with direct function calls appears to
e6e23a
      be the fastest.  */
e6e23a
-  if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
e6e23a
+  if (__glibc_likely (_dl_dso_sort_algo == dso_sort_algorithm_original))
e6e23a
     _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
e6e23a
   else
e6e23a
     _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
e6e23a
diff --git a/elf/dl-support.c b/elf/dl-support.c
e6e23a
index ae03aec9764e29d3..e9943e889ef447ad 100644
e6e23a
--- a/elf/dl-support.c
e6e23a
+++ b/elf/dl-support.c
e6e23a
@@ -155,8 +155,6 @@ size_t _dl_phnum;
e6e23a
 uint64_t _dl_hwcap __attribute__ ((nocommon));
e6e23a
 uint64_t _dl_hwcap2 __attribute__ ((nocommon));
e6e23a
 
e6e23a
-enum dso_sort_algorithm _dl_dso_sort_algo;
e6e23a
-
e6e23a
 /* The value of the FPU control word the kernel will preset in hardware.  */
e6e23a
 fpu_control_t _dl_fpu_control = _FPU_DEFAULT;
e6e23a
 
e6e23a
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
e6e23a
index 2c1b4c47c6a6c643..29bbde3e83e37d7e 100644
e6e23a
--- a/sysdeps/generic/ldsodefs.h
e6e23a
+++ b/sysdeps/generic/ldsodefs.h
e6e23a
@@ -240,13 +240,6 @@ enum allowmask
e6e23a
   };
e6e23a
 
e6e23a
 
e6e23a
-/* DSO sort algorithm to use (check dl-sort-maps.c).  */
e6e23a
-enum dso_sort_algorithm
e6e23a
-  {
e6e23a
-    dso_sort_algorithm_original,
e6e23a
-    dso_sort_algorithm_dfs
e6e23a
-  };
e6e23a
-
e6e23a
 struct audit_ifaces
e6e23a
 {
e6e23a
   void (*activity) (uintptr_t *, unsigned int);
e6e23a
@@ -640,8 +633,6 @@ struct rtld_global_ro
e6e23a
      platforms.  */
e6e23a
   EXTERN uint64_t _dl_hwcap2;
e6e23a
 
e6e23a
-  EXTERN enum dso_sort_algorithm _dl_dso_sort_algo;
e6e23a
-
e6e23a
 #ifdef SHARED
e6e23a
   /* We add a function table to _rtld_global which is then used to
e6e23a
      call the function instead of going through the PLT.  The result