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