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